From 0107674a436615b2c81bff22cda8f9aece18d278 Mon Sep 17 00:00:00 2001 From: github-actions-bot Date: Wed, 17 Jan 2024 09:55:56 +0000 Subject: [PATCH] Updates --- iframe.html | 4 +- ...undle.js => main.308d18dd.iframe.bundle.js | 46 +++++++++---------- main.308d18dd.iframe.bundle.js.map | 1 + main.44e1b471.iframe.bundle.js.map | 1 - project.json | 2 +- ... => runtime~main.8f374b57.iframe.bundle.js | 2 +- ...pleTable-stories.973c0267.iframe.bundle.js | 4 +- ...able-stories.973c0267.iframe.bundle.js.map | 2 +- ...ableRows-stories.50882eda.iframe.bundle.js | 6 +-- ...Rows-stories.50882eda.iframe.bundle.js.map | 2 +- 10 files changed, 35 insertions(+), 35 deletions(-) rename main.44e1b471.iframe.bundle.js => main.308d18dd.iframe.bundle.js (99%) create mode 100644 main.308d18dd.iframe.bundle.js.map delete mode 100644 main.44e1b471.iframe.bundle.js.map rename runtime~main.bc6254c6.iframe.bundle.js => runtime~main.8f374b57.iframe.bundle.js (98%) rename tables-SimpleTable-stories.a97ccecb.iframe.bundle.js => tables-SimpleTable-stories.973c0267.iframe.bundle.js (98%) rename tables-SimpleTable-stories.a97ccecb.iframe.bundle.js.map => tables-SimpleTable-stories.973c0267.iframe.bundle.js.map (98%) rename tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js => tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js (98%) rename tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js.map => tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js.map (96%) diff --git a/iframe.html b/iframe.html index 4ee1745dd..4418e03fa 100644 --- a/iframe.html +++ b/iframe.html @@ -348,8 +348,8 @@ window['DOCS_OPTIONS'] = {"defaultName":"Docs","autodocs":true}; \ No newline at end of file + import './main.308d18dd.iframe.bundle.js'; \ No newline at end of file diff --git a/main.44e1b471.iframe.bundle.js b/main.308d18dd.iframe.bundle.js similarity index 99% rename from main.44e1b471.iframe.bundle.js rename to main.308d18dd.iframe.bundle.js index 81d313a59..2041dd582 100644 --- a/main.44e1b471.iframe.bundle.js +++ b/main.308d18dd.iframe.bundle.js @@ -33,7 +33,7 @@ height: 40px; justify-content: space-between; padding: 9px 4px 9px 10px; -`,Title=styled_components__WEBPACK_IMPORTED_MODULE_1__.ZP.span.attrs((props=>({title:String(props.children)})))` +`,Title=styled_components__WEBPACK_IMPORTED_MODULE_1__.ZP.span.attrs((props=>({title:props.title??String(props.children)})))` color: ${p=>p.theme.color.white}; font-size: 16px; line-height: 22px; @@ -152,7 +152,7 @@ border: 1px solid ${p=>p.theme.color.lightGray}; color: ${p=>p.theme.color.lightGray}; } -`;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{Icon:{defaultValue:null,description:"",name:"Icon",required:!1,type:{name:"FunctionComponent"}},accent:{defaultValue:{value:"Accent.PRIMARY"},description:"",name:"accent",required:!1,type:{name:"enum",value:[{value:'"PRIMARY"'},{value:'"SECONDARY"'},{value:'"TERTIARY"'}]}},isFullWidth:{defaultValue:{value:"false"},description:"",name:"isFullWidth",required:!1,type:{name:"boolean"}},size:{defaultValue:{value:"Size.NORMAL"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"LARGE"'},{value:'"NORMAL"'},{value:'"SMALL"'}]}},withUnpropagatedClick:{defaultValue:{value:"false"},description:"Prevent onClick event propagation.",name:"withUnpropagatedClick",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/elements/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}try{PrimaryButton.displayName="PrimaryButton",PrimaryButton.__docgenInfo={description:"",displayName:"PrimaryButton",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLButtonElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#PrimaryButton"]={docgenInfo:PrimaryButton.__docgenInfo,name:"PrimaryButton",path:"src/elements/Button.tsx#PrimaryButton"})}catch(__react_docgen_typescript_loader_error){}try{SecondaryButton.displayName="SecondaryButton",SecondaryButton.__docgenInfo={description:"",displayName:"SecondaryButton",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLButtonElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#SecondaryButton"]={docgenInfo:SecondaryButton.__docgenInfo,name:"SecondaryButton",path:"src/elements/Button.tsx#SecondaryButton"})}catch(__react_docgen_typescript_loader_error){}try{TertiaryButton.displayName="TertiaryButton",TertiaryButton.__docgenInfo={description:"",displayName:"TertiaryButton",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLButtonElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#TertiaryButton"]={docgenInfo:TertiaryButton.__docgenInfo,name:"TertiaryButton",path:"src/elements/Button.tsx#TertiaryButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/elements/IconButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{h:()=>IconButton});var classnames__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),styled_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/styled-components/dist/styled-components.browser.esm.js"),_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/elements/Button.tsx"),_constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/constants.ts"),_utils_stopMouseEventPropagation__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/utils/stopMouseEventPropagation.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ICON_SIZE_IN_PX={[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.LARGE]:26,[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.NORMAL]:20,[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.SMALL]:14};function IconButton({accent=_constants__WEBPACK_IMPORTED_MODULE_3__.Le.PRIMARY,className,color,Icon,iconSize,isCompact,onClick,size=_constants__WEBPACK_IMPORTED_MODULE_3__.$u.NORMAL,type="button",withUnpropagatedClick=!1,...nativeProps}){const handleClick=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((event=>{withUnpropagatedClick&&(0,_utils_stopMouseEventPropagation__WEBPACK_IMPORTED_MODULE_5__.k)(event),onClick&&onClick(event)}),[onClick,withUnpropagatedClick]),commonChildren=(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((()=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Icon,{color,size:iconSize||ICON_SIZE_IN_PX[size]})),[color,Icon,iconSize,size]),commonProps=(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((()=>({children:commonChildren,className:classnames__WEBPACK_IMPORTED_MODULE_0___default()("Element-IconButton",className),isCompact,onClick:handleClick,size,type,...nativeProps})),[className,commonChildren,handleClick,isCompact,nativeProps,size,type]);switch(accent){case _constants__WEBPACK_IMPORTED_MODULE_3__.Le.SECONDARY:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.kq,{as:StyledButton,...commonProps});case _constants__WEBPACK_IMPORTED_MODULE_3__.Le.TERTIARY:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(TertiaryButton,{as:StyledButton,...commonProps});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.KM,{as:StyledButton,...commonProps})}}const PADDING={[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.LARGE]:"7px",[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.NORMAL]:"5px",[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.SMALL]:"3px"},StyledButton=styled_components__WEBPACK_IMPORTED_MODULE_6__.ZP.button` +`;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{Icon:{defaultValue:null,description:"",name:"Icon",required:!1,type:{name:"FunctionComponent"}},accent:{defaultValue:{value:"Accent.PRIMARY"},description:"",name:"accent",required:!1,type:{name:"enum",value:[{value:'"PRIMARY"'},{value:'"SECONDARY"'},{value:'"TERTIARY"'}]}},isFullWidth:{defaultValue:{value:"false"},description:"",name:"isFullWidth",required:!1,type:{name:"boolean"}},size:{defaultValue:{value:"Size.NORMAL"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"LARGE"'},{value:'"NORMAL"'},{value:'"SMALL"'}]}},withUnpropagatedClick:{defaultValue:{value:"false"},description:"Prevent onClick event propagation.",name:"withUnpropagatedClick",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/elements/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}try{PrimaryButton.displayName="PrimaryButton",PrimaryButton.__docgenInfo={description:"",displayName:"PrimaryButton",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLButtonElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#PrimaryButton"]={docgenInfo:PrimaryButton.__docgenInfo,name:"PrimaryButton",path:"src/elements/Button.tsx#PrimaryButton"})}catch(__react_docgen_typescript_loader_error){}try{SecondaryButton.displayName="SecondaryButton",SecondaryButton.__docgenInfo={description:"",displayName:"SecondaryButton",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLButtonElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#SecondaryButton"]={docgenInfo:SecondaryButton.__docgenInfo,name:"SecondaryButton",path:"src/elements/Button.tsx#SecondaryButton"})}catch(__react_docgen_typescript_loader_error){}try{TertiaryButton.displayName="TertiaryButton",TertiaryButton.__docgenInfo={description:"",displayName:"TertiaryButton",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLButtonElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Button.tsx#TertiaryButton"]={docgenInfo:TertiaryButton.__docgenInfo,name:"TertiaryButton",path:"src/elements/Button.tsx#TertiaryButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/elements/IconButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{h:()=>IconButton});var classnames__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),styled_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/styled-components/dist/styled-components.browser.esm.js"),_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/elements/Button.tsx"),_constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/constants.ts"),_utils_stopMouseEventPropagation__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/utils/stopMouseEventPropagation.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ICON_SIZE_IN_PX={[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.LARGE]:26,[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.NORMAL]:20,[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.SMALL]:14};function IconButton({accent=_constants__WEBPACK_IMPORTED_MODULE_3__.Le.PRIMARY,className,color,Icon,iconSize,isCompact,onClick,size=_constants__WEBPACK_IMPORTED_MODULE_3__.$u.NORMAL,type="button",withUnpropagatedClick=!1,...nativeProps}){const handleClick=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((event=>{withUnpropagatedClick&&(0,_utils_stopMouseEventPropagation__WEBPACK_IMPORTED_MODULE_5__.k)(event),onClick&&onClick(event)}),[onClick,withUnpropagatedClick]),commonChildren=(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((()=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Icon,{color,size:iconSize??ICON_SIZE_IN_PX[size]})),[color,Icon,iconSize,size]),commonProps=(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((()=>({children:commonChildren,className:classnames__WEBPACK_IMPORTED_MODULE_0___default()("Element-IconButton",className),isCompact,onClick:handleClick,size,type,...nativeProps})),[className,commonChildren,handleClick,isCompact,nativeProps,size,type]);switch(accent){case _constants__WEBPACK_IMPORTED_MODULE_3__.Le.SECONDARY:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.kq,{as:StyledButton,...commonProps});case _constants__WEBPACK_IMPORTED_MODULE_3__.Le.TERTIARY:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(TertiaryButton,{as:StyledButton,...commonProps});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.KM,{as:StyledButton,...commonProps})}}const PADDING={[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.LARGE]:"7px",[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.NORMAL]:"5px",[_constants__WEBPACK_IMPORTED_MODULE_3__.$u.SMALL]:"3px"},StyledButton=styled_components__WEBPACK_IMPORTED_MODULE_6__.ZP.button` align-items: center; display: flex; justify-content: center; @@ -598,9 +598,9 @@ color: ${p=>p.theme.color.blueYonder25}; } `;try{SingleTag.displayName="SingleTag",SingleTag.__docgenInfo={description:"",displayName:"SingleTag",props:{accent:{defaultValue:{value:"Accent.PRIMARY"},description:"",name:"accent",required:!1,type:{name:"enum",value:[{value:'"PRIMARY"'},{value:'"SECONDARY"'},{value:'"TERTIARY"'}]}},onDelete:{defaultValue:null,description:"",name:"onDelete",required:!0,type:{name:"() => Promisable"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/SingleTag.tsx#SingleTag"]={docgenInfo:SingleTag.__docgenInfo,name:"SingleTag",path:"src/elements/SingleTag.tsx#SingleTag"})}catch(__react_docgen_typescript_loader_error){}__webpack_require__("./src/components/MapMenuDialog/index.tsx");const ExclamationPoint=styled_components_browser_esm.ZP.span` - background: ${p=>p.backgroundColor||p.theme.color.goldenPoppy}; + background: ${p=>p.backgroundColor??p.theme.color.goldenPoppy}; border-radius: 15px; - color: ${p=>p.color||p.theme.color.white}; + color: ${p=>p.color??p.theme.color.white}; display: inline-block; font-size: 11px; font-weight: 700; @@ -616,8 +616,8 @@ `;try{ExclamationPoint.displayName="ExclamationPoint",ExclamationPoint.__docgenInfo={description:"",displayName:"ExclamationPoint",props:{backgroundColor:{defaultValue:null,description:"",name:"backgroundColor",required:!1,type:{name:"string"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLSpanElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/symbols/ExclamationPoint.tsx#ExclamationPoint"]={docgenInfo:ExclamationPoint.__docgenInfo,name:"ExclamationPoint",path:"src/symbols/ExclamationPoint.tsx#ExclamationPoint"})}catch(__react_docgen_typescript_loader_error){}function Message({children,level=constants.aC.WARNING,...nativeProps}){return constants.aC.WARNING,(0,jsx_runtime.jsxs)(Message_Box,{backgroundColor:THEME.color.goldenPoppy25,color:THEME.color.slateGray,...nativeProps,children:[(0,jsx_runtime.jsx)(StyledExclamationPoint,{backgroundColor:THEME.color.goldenPoppy,color:THEME.color.white}),(0,jsx_runtime.jsx)(Text,{children})]})}const Text=styled_components_browser_esm.ZP.div` margin-left: 8px; `,Message_Box=styled_components_browser_esm.ZP.span` - background: ${p=>p.backgroundColor||p.theme.color.goldenPoppy25}; - color: ${p=>p.color||p.theme.color.slateGray}; + background: ${p=>p.backgroundColor??p.theme.color.goldenPoppy25}; + color: ${p=>p.color??p.theme.color.slateGray}; padding: 8px 16px 16px 8px; display: flex; border-radius: 2px; @@ -663,7 +663,7 @@ font-size: 13px; line-height: 1.3846; margin-bottom: 4px; -`;try{Label.displayName="Label",Label.__docgenInfo={description:"",displayName:"Label",props:{disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},hasError:{defaultValue:null,description:"",name:"hasError",required:!1,type:{name:"boolean"}},isHidden:{defaultValue:null,description:"",name:"isHidden",required:!1,type:{name:"boolean"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLLabelElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Label.tsx#Label"]={docgenInfo:Label.__docgenInfo,name:"Label",path:"src/elements/Label.tsx#Label"})}catch(__react_docgen_typescript_loader_error){}function Tag({accent,backgroundColor,borderColor,bullet,bulletColor,children,className,color,Icon,iconColor,isLight=!1,withBullet=!1,...nativeProps}){const withDot=(0,react.useMemo)((()=>(bullet===constants._f.DISK||withBullet)&&!Icon),[bullet,Icon,withBullet]),commonChildren=(0,react.useMemo)((()=>{const defaultColor=color||THEME.color.gunMetal,cutomIconColor=bulletColor||iconColor||(accent?{[constants.Le.PRIMARY]:THEME.color.gunMetal,[constants.Le.SECONDARY]:THEME.color.gunMetal,[constants.Le.TERTIARY]:THEME.color.white}[accent]:defaultColor);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[Icon&&(0,jsx_runtime.jsx)(Icon,{color:cutomIconColor,size:16}),withDot&&(0,jsx_runtime.jsx)(icons.DotFilled,{color:cutomIconColor,size:20}),children]})}),[accent,bulletColor,color,children,Icon,withDot,iconColor]),commonProps=(0,react.useMemo)((()=>({$isLight:isLight,$withBullet:withDot,children:commonChildren,className:classnames_default()("Element-Tag",className),...nativeProps})),[className,commonChildren,isLight,nativeProps,withDot]);switch(accent){case constants.Le.PRIMARY:return(0,jsx_runtime.jsx)(PrimaryTag,{...commonProps});case constants.Le.SECONDARY:return(0,jsx_runtime.jsx)(SecondaryTag,{...commonProps});case constants.Le.TERTIARY:return(0,jsx_runtime.jsx)(TertiaryTag,{...commonProps});default:return(0,jsx_runtime.jsx)(Tag_Box,{$backgroundColor:backgroundColor,$borderColor:borderColor,$color:color,...commonProps})}}const Tag_Box=styled_components_browser_esm.ZP.span` +`;try{Label.displayName="Label",Label.__docgenInfo={description:"",displayName:"Label",props:{disabled:{defaultValue:null,description:"",name:"disabled",required:!1,type:{name:"boolean"}},hasError:{defaultValue:null,description:"",name:"hasError",required:!1,type:{name:"boolean"}},isHidden:{defaultValue:null,description:"",name:"isHidden",required:!1,type:{name:"boolean"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLLabelElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/Label.tsx#Label"]={docgenInfo:Label.__docgenInfo,name:"Label",path:"src/elements/Label.tsx#Label"})}catch(__react_docgen_typescript_loader_error){}function Tag({accent,backgroundColor,borderColor,bullet,bulletColor,children,className,color,Icon,iconColor,isLight=!1,withBullet=!1,...nativeProps}){const withDot=(0,react.useMemo)((()=>(bullet===constants._f.DISK||withBullet)&&!Icon),[bullet,Icon,withBullet]),commonChildren=(0,react.useMemo)((()=>{const defaultColor=color??THEME.color.gunMetal,cutomIconColor=bulletColor??iconColor??(accent?{[constants.Le.PRIMARY]:THEME.color.gunMetal,[constants.Le.SECONDARY]:THEME.color.gunMetal,[constants.Le.TERTIARY]:THEME.color.white}[accent]:defaultColor);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[Icon&&(0,jsx_runtime.jsx)(Icon,{color:cutomIconColor,size:16}),withDot&&(0,jsx_runtime.jsx)(icons.DotFilled,{color:cutomIconColor,size:20}),children]})}),[accent,bulletColor,color,children,Icon,withDot,iconColor]),commonProps=(0,react.useMemo)((()=>({$isLight:isLight,$withBullet:withDot,children:commonChildren,className:classnames_default()("Element-Tag",className),...nativeProps})),[className,commonChildren,isLight,nativeProps,withDot]);switch(accent){case constants.Le.PRIMARY:return(0,jsx_runtime.jsx)(PrimaryTag,{...commonProps});case constants.Le.SECONDARY:return(0,jsx_runtime.jsx)(SecondaryTag,{...commonProps});case constants.Le.TERTIARY:return(0,jsx_runtime.jsx)(TertiaryTag,{...commonProps});default:return(0,jsx_runtime.jsx)(Tag_Box,{$backgroundColor:backgroundColor,$borderColor:borderColor,$color:color,...commonProps})}}const Tag_Box=styled_components_browser_esm.ZP.span` align-items: ${p=>p.$withBullet?"flex-start":"end"}; align-self: flex-start; background-color: ${p=>p.$backgroundColor?p.$backgroundColor:p.$isLight?p.theme.color.white:"transparent"}; @@ -699,7 +699,7 @@ display: flex; flex-wrap: wrap; gap: 8px; -`;try{TagGroup.displayName="TagGroup",TagGroup.__docgenInfo={description:"",displayName:"TagGroup",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLDivElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/TagGroup.tsx#TagGroup"]={docgenInfo:TagGroup.__docgenInfo,name:"TagGroup",path:"src/elements/TagGroup.tsx#TagGroup"})}catch(__react_docgen_typescript_loader_error){}var AutoComplete=__webpack_require__("./node_modules/rsuite/esm/AutoComplete/index.js"),pipe=__webpack_require__("./node_modules/ramda/es/pipe.js"),map=__webpack_require__("./node_modules/ramda/es/map.js"),any=__webpack_require__("./node_modules/ramda/es/any.js"),identity=__webpack_require__("./node_modules/ramda/es/identity.js");const useClickOutsideEffect=(zoneRefOrzoneRefs,action,baseContainer)=>{const handleClickOutside=(0,react.useCallback)((event=>{const eventTarget=event.target,zoneRefs=Array.isArray(zoneRefOrzoneRefs)?zoneRefOrzoneRefs:[zoneRefOrzoneRefs];(0,pipe.Z)((0,map.Z)((zoneRef=>!(!zoneRef.current||!eventTarget)&&zoneRef.current.contains(eventTarget))),(0,any.Z)(identity.Z))(zoneRefs)||action()}),[action,zoneRefOrzoneRefs]);(0,react.useEffect)((()=>{const globalContainer=baseContainer??window.document;return globalContainer.addEventListener("click",handleClickOutside),()=>{globalContainer.removeEventListener("click",handleClickOutside)}}),[baseContainer,handleClickOutside])};function usePrevious_usePrevious(value){const ref=(0,react.useRef)();return(0,react.useEffect)((()=>{ref.current=value}),[value]),ref.current}function useFieldUndefineEffect(disabled,onChange,onDisable){const wasDisabled=usePrevious_usePrevious(disabled);(0,react.useEffect)((()=>{disabled&&disabled!==wasDisabled&&(onDisable&&onDisable(),onChange&&onChange(void 0))}),[disabled,onChange,onDisable,wasDisabled])}var lodash=__webpack_require__("./node_modules/lodash/lodash.js");function useForceUpdate(){const[,forceUpdate]=(0,react.useReducer)((x=>x+1),0);return{forceDebouncedUpdate:(0,react.useMemo)((()=>(0,lodash.throttle)(forceUpdate,500)),[forceUpdate]),forceUpdate}}function getPseudoRandomString(){return`${(new Date).toISOString()}${Math.random().toString(36).slice(2)}`}function useKey(deps){const keyRef=(0,react.useRef)(getPseudoRandomString()),prevDeps=usePrevious_usePrevious(deps);return(0,lodash.isEqual)(deps,prevDeps)||(keyRef.current=getPseudoRandomString()),keyRef.current}function getRsuiteValueFromOptionValue(optionValue,optionValueKey){return void 0!==optionValue?String(optionValueKey?optionValue[optionValueKey]:optionValue):void 0}function getRsuiteDataFromOptions(options,optionValueKey){return options.map((({value,...rest})=>({...rest,optionValue:value,value:getRsuiteValueFromOptionValue(value,optionValueKey)})))}function normalizeString(text){if(!text)return;const cleanText=function cleanString(text){return text.replace(/\s+/g," ").trim()}(text);return cleanText.length>0?cleanText:void 0}function Search({baseContainer,className,customSearch,customSearchMinQueryLength=1,error,isErrorMessageHidden=!1,isLabelHidden,isLight=!1,isSearchIconVisible=!0,label,MenuItem,onChange,onQuery,options=[],optionValueKey,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),queryRef=(0,react.useRef)(void 0),data=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),[isOpen,setIsOpen]=(0,react.useState)(!1),{forceUpdate}=useForceUpdate(),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-Search",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([value,originalProps.disabled,originalProps.name]),rsuiteValue=(0,react.useMemo)((()=>getRsuiteValueFromOptionValue(value,optionValueKey)),[value,optionValueKey]),[inputValue,setInputValue]=(0,react.useState)(rsuiteValue),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?[]:void 0),close=(0,react.useCallback)((()=>{setIsOpen(!1)}),[]),clean=(0,react.useCallback)((()=>{setInputValue(""),setIsOpen(!1)}),[]),handleChange=(0,react.useCallback)((async(nextQuery,event)=>{if("string"==typeof nextQuery){if(customSearch&&customSearchRef.current){const nextControlledRsuiteData=nextQuery.trim().length>=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):[];setControlledRsuiteData(nextControlledRsuiteData)}queryRef.current=normalizeString(nextQuery),"change"===event.type?(setInputValue(nextQuery),setIsOpen(Boolean(queryRef.current))):setIsOpen(!1),onChange&&!queryRef.current&&onChange(void 0),onQuery&&onQuery(queryRef.current)}}),[customSearch,onChange,onQuery,customSearchMinQueryLength,optionValueKey]),handleSelect=(0,react.useCallback)(((_,item)=>{onChange&&onChange(item.optionValue),setInputValue(item.label)}),[onChange]);return useFieldUndefineEffect(originalProps.disabled,onChange),useClickOutsideEffect(boxRef,close,baseContainer),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassName,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsxs)(Search_Box,{ref:boxRef,isLight,children:[boxRef.current&&(0,jsx_runtime.jsx)(StyledAutoComplete,{$isLight:isLight,container:boxRef.current,data:controlledRsuiteData||data,filterBy:customSearch?()=>!0:void 0,id:originalProps.name,onChange:handleChange,onSelect:handleSelect,open:isOpen,renderMenuItem:(itemLabel,item)=>MenuItem?(0,jsx_runtime.jsx)(MenuItem,{item:item.value}):itemLabel,value:inputValue,...originalProps},key),inputValue&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(StyledCloseButton,{accent:constants.Le.TERTIARY,color:THEME.color.slateGray,Icon:icons.Close,isSearchIconVisible,onClick:clean,size:constants.$u.SMALL}),isSearchIconVisible&&(0,jsx_runtime.jsx)(Separator,{children:"|"})]}),isSearchIconVisible&&(0,jsx_runtime.jsx)(StyledIconSearch,{color:THEME.color.slateGray,size:20})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}Search.displayName="Search";const StyledCloseButton=(0,styled_components_browser_esm.ZP)(IconButton.h)` +`;try{TagGroup.displayName="TagGroup",TagGroup.__docgenInfo={description:"",displayName:"TagGroup",props:{ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"((instance: HTMLDivElement | null) => void) | RefObject | null"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"any"}},as:{defaultValue:null,description:"",name:"as",required:!1,type:{name:"undefined"}},forwardedAs:{defaultValue:null,description:"",name:"forwardedAs",required:!1,type:{name:"undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/elements/TagGroup.tsx#TagGroup"]={docgenInfo:TagGroup.__docgenInfo,name:"TagGroup",path:"src/elements/TagGroup.tsx#TagGroup"})}catch(__react_docgen_typescript_loader_error){}var AutoComplete=__webpack_require__("./node_modules/rsuite/esm/AutoComplete/index.js"),pipe=__webpack_require__("./node_modules/ramda/es/pipe.js"),map=__webpack_require__("./node_modules/ramda/es/map.js"),any=__webpack_require__("./node_modules/ramda/es/any.js"),identity=__webpack_require__("./node_modules/ramda/es/identity.js");const useClickOutsideEffect=(zoneRefOrzoneRefs,action,baseContainer)=>{const handleClickOutside=(0,react.useCallback)((event=>{const eventTarget=event.target,zoneRefs=Array.isArray(zoneRefOrzoneRefs)?zoneRefOrzoneRefs:[zoneRefOrzoneRefs];(0,pipe.Z)((0,map.Z)((zoneRef=>!(!zoneRef.current||!eventTarget)&&zoneRef.current.contains(eventTarget))),(0,any.Z)(identity.Z))(zoneRefs)||action()}),[action,zoneRefOrzoneRefs]);(0,react.useEffect)((()=>{const globalContainer=baseContainer??window.document;return globalContainer.addEventListener("click",handleClickOutside),()=>{globalContainer.removeEventListener("click",handleClickOutside)}}),[baseContainer,handleClickOutside])};function usePrevious_usePrevious(value){const ref=(0,react.useRef)();return(0,react.useEffect)((()=>{ref.current=value}),[value]),ref.current}function useFieldUndefineEffect(disabled,onChange,onDisable){const wasDisabled=usePrevious_usePrevious(disabled);(0,react.useEffect)((()=>{disabled&&disabled!==wasDisabled&&(onDisable&&onDisable(),onChange&&onChange(void 0))}),[disabled,onChange,onDisable,wasDisabled])}var lodash=__webpack_require__("./node_modules/lodash/lodash.js");function useForceUpdate(){const[,forceUpdate]=(0,react.useReducer)((x=>x+1),0);return{forceDebouncedUpdate:(0,react.useMemo)((()=>(0,lodash.throttle)(forceUpdate,500)),[forceUpdate]),forceUpdate}}function getPseudoRandomString(){return`${(new Date).toISOString()}${Math.random().toString(36).slice(2)}`}function useKey(deps){const keyRef=(0,react.useRef)(getPseudoRandomString()),prevDeps=usePrevious_usePrevious(deps);return(0,lodash.isEqual)(deps,prevDeps)||(keyRef.current=getPseudoRandomString()),keyRef.current}function getRsuiteValueFromOptionValue(optionValue,optionValueKey){return void 0!==optionValue?String(optionValueKey?optionValue[optionValueKey]:optionValue):void 0}function getRsuiteDataFromOptions(options,optionValueKey){return options.map((({value,...rest})=>({...rest,optionValue:value,value:getRsuiteValueFromOptionValue(value,optionValueKey)})))}function normalizeString(text){if(!text)return;const cleanText=function cleanString(text){return text.replace(/\s+/g," ").trim()}(text);return cleanText.length>0?cleanText:void 0}function Search({baseContainer,className,customSearch,customSearchMinQueryLength=1,error,isErrorMessageHidden=!1,isLabelHidden,isLight=!1,isSearchIconVisible=!0,label,MenuItem,onChange,onQuery,options=[],optionValueKey,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),queryRef=(0,react.useRef)(void 0),data=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),[isOpen,setIsOpen]=(0,react.useState)(!1),{forceUpdate}=useForceUpdate(),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-Search",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([value,originalProps.disabled,originalProps.name]),rsuiteValue=(0,react.useMemo)((()=>getRsuiteValueFromOptionValue(value,optionValueKey)),[value,optionValueKey]),[inputValue,setInputValue]=(0,react.useState)(rsuiteValue),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?[]:void 0),close=(0,react.useCallback)((()=>{setIsOpen(!1)}),[]),clean=(0,react.useCallback)((()=>{setInputValue(""),setIsOpen(!1)}),[]),handleChange=(0,react.useCallback)((async(nextQuery,event)=>{if("string"==typeof nextQuery){if(customSearch&&customSearchRef.current){const nextControlledRsuiteData=nextQuery.trim().length>=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):[];setControlledRsuiteData(nextControlledRsuiteData)}queryRef.current=normalizeString(nextQuery),"change"===event.type?(setInputValue(nextQuery),setIsOpen(Boolean(queryRef.current))):setIsOpen(!1),onChange&&!queryRef.current&&onChange(void 0),onQuery&&onQuery(queryRef.current)}}),[customSearch,onChange,onQuery,customSearchMinQueryLength,optionValueKey]),handleSelect=(0,react.useCallback)(((_,item)=>{onChange&&onChange(item.optionValue),setInputValue(item.label)}),[onChange]);return useFieldUndefineEffect(originalProps.disabled,onChange),useClickOutsideEffect(boxRef,close,baseContainer),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassName,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsxs)(Search_Box,{ref:boxRef,isLight,children:[boxRef.current&&(0,jsx_runtime.jsx)(StyledAutoComplete,{$isLight:isLight,container:boxRef.current,data:controlledRsuiteData??data,filterBy:customSearch?()=>!0:void 0,id:originalProps.name,onChange:handleChange,onSelect:handleSelect,open:isOpen,renderMenuItem:(itemLabel,item)=>MenuItem?(0,jsx_runtime.jsx)(MenuItem,{item:item.value}):itemLabel,value:inputValue,...originalProps},key),inputValue&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(StyledCloseButton,{accent:constants.Le.TERTIARY,color:THEME.color.slateGray,Icon:icons.Close,isSearchIconVisible,onClick:clean,size:constants.$u.SMALL}),isSearchIconVisible&&(0,jsx_runtime.jsx)(Separator,{children:"|"})]}),isSearchIconVisible&&(0,jsx_runtime.jsx)(StyledIconSearch,{color:THEME.color.slateGray,size:20})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}Search.displayName="Search";const StyledCloseButton=(0,styled_components_browser_esm.ZP)(IconButton.h)` cursor: pointer; height: 30px; margin: 5px ${p=>p.isSearchIconVisible?0:5}px 5px 5px; @@ -773,7 +773,7 @@ // in readOnly, override hover effects and change cursor ${props=>props.readOnly&&`\n > .rs-checkbox-checker:hover {\n label {\n cursor: not-allowed;\n }\n .rs-checkbox-wrapper .rs-checkbox-inner::before {\n border-color: ${props.theme.color.lightGray};\n background-color: ${props.theme.color.gainsboro};\n }\n }\n\n &.rs-checkbox-checked {\n > .rs-checkbox-checker:hover {\n .rs-checkbox-wrapper .rs-checkbox-inner::before {\n border-color: ${props.theme.color.charcoal};\n background-color: ${props.theme.color.charcoal};\n }\n }\n }\n `} -`;try{Checkbox_Checkbox.displayName="Checkbox",Checkbox_Checkbox.__docgenInfo={description:"",displayName:"Checkbox",props:{checked:{defaultValue:{value:"false"},description:"",name:"checked",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((isChecked: boolean) => Promisable)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/Checkbox.tsx#Checkbox"]={docgenInfo:Checkbox_Checkbox.__docgenInfo,name:"Checkbox",path:"src/fields/Checkbox.tsx#Checkbox"})}catch(__react_docgen_typescript_loader_error){}var CheckPicker=__webpack_require__("./node_modules/rsuite/esm/CheckPicker/index.js");function CheckPicker_CheckPicker({className,customSearch,customSearchMinQueryLength=1,disabled=!1,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,options,optionValueKey,searchable=!1,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-CheckPicker",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),rsuiteData=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([disabled,originalProps.name]),selectedRsuiteValue=(0,react.useMemo)((()=>function getRsuiteValuesFromOptionValues(optionValues,optionValueKey){return optionValues&&0!==optionValues.length?optionValues.filter((optionValue=>void 0!==optionValue)).map((optionValue=>String(optionValueKey?optionValue[optionValueKey]:optionValue))):[]}(value,optionValueKey)),[optionValueKey,value]),{forceUpdate}=useForceUpdate(),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?rsuiteData:void 0),getOptionValuesFromRsuiteDataValues=(0,react.useCallback)((rsuiteValues=>rsuiteData.reduce(((optionsValues,rsuiteDataItem)=>rsuiteValues.includes(rsuiteDataItem.value)?[...optionsValues,rsuiteDataItem.optionValue]:optionsValues),[])),[rsuiteData]),handleChange=(0,react.useCallback)((nextOptionRsuiteValues=>{if(!onChange)return;const nextValue=nextOptionRsuiteValues?getOptionValuesFromRsuiteDataValues(nextOptionRsuiteValues):[],normalizedNextValue=nextValue.length>0?nextValue:void 0;setControlledRsuiteData(rsuiteData),onChange(normalizedNextValue)}),[getOptionValuesFromRsuiteDataValues,onChange,rsuiteData]),handleSearch=(0,react.useCallback)((nextQuery=>{if(!customSearchRef.current||nextQuery.trim().length=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):rsuiteData;setControlledRsuiteData(nextControlledRsuiteData)}),[customSearchMinQueryLength,optionValueKey,rsuiteData]),renderMenuItem=(0,react.useCallback)((node=>(0,jsx_runtime.jsx)("span",{title:String(node),children:String(node)})),[]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassName,style,children:[(0,jsx_runtime.jsx)(Label,{disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(CheckPicker_Box,{ref:boxRef,$hasError:hasError,$isLight:isLight,children:boxRef.current&&(0,jsx_runtime.jsx)(CheckPicker.Z,{container:boxRef.current,data:controlledRsuiteData||rsuiteData,disabled,id:originalProps.name,onChange:handleChange,onSearch:handleSearch,renderMenuItem,searchable:!!customSearch||searchable,searchBy:customSearch?()=>!0:void 0,size:originalProps.size||"sm",value:selectedRsuiteValue,...originalProps},key)}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}CheckPicker_CheckPicker.displayName="CheckPicker";const CheckPicker_Box=styled_components_browser_esm.ZP.div` +`;try{Checkbox_Checkbox.displayName="Checkbox",Checkbox_Checkbox.__docgenInfo={description:"",displayName:"Checkbox",props:{checked:{defaultValue:{value:"false"},description:"",name:"checked",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((isChecked: boolean) => Promisable)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/Checkbox.tsx#Checkbox"]={docgenInfo:Checkbox_Checkbox.__docgenInfo,name:"Checkbox",path:"src/fields/Checkbox.tsx#Checkbox"})}catch(__react_docgen_typescript_loader_error){}var CheckPicker=__webpack_require__("./node_modules/rsuite/esm/CheckPicker/index.js");function CheckPicker_CheckPicker({className,customSearch,customSearchMinQueryLength=1,disabled=!1,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,options,optionValueKey,searchable=!1,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-CheckPicker",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),rsuiteData=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([disabled,originalProps.name]),selectedRsuiteValue=(0,react.useMemo)((()=>function getRsuiteValuesFromOptionValues(optionValues,optionValueKey){return optionValues&&0!==optionValues.length?optionValues.filter((optionValue=>void 0!==optionValue)).map((optionValue=>String(optionValueKey?optionValue[optionValueKey]:optionValue))):[]}(value,optionValueKey)),[optionValueKey,value]),{forceUpdate}=useForceUpdate(),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?rsuiteData:void 0),getOptionValuesFromRsuiteDataValues=(0,react.useCallback)((rsuiteValues=>rsuiteData.reduce(((optionsValues,rsuiteDataItem)=>rsuiteValues.includes(rsuiteDataItem.value)?[...optionsValues,rsuiteDataItem.optionValue]:optionsValues),[])),[rsuiteData]),handleChange=(0,react.useCallback)((nextOptionRsuiteValues=>{if(!onChange)return;const nextValue=nextOptionRsuiteValues?getOptionValuesFromRsuiteDataValues(nextOptionRsuiteValues):[],normalizedNextValue=nextValue.length>0?nextValue:void 0;setControlledRsuiteData(rsuiteData),onChange(normalizedNextValue)}),[getOptionValuesFromRsuiteDataValues,onChange,rsuiteData]),handleSearch=(0,react.useCallback)((nextQuery=>{if(!customSearchRef.current||nextQuery.trim().length=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):rsuiteData;setControlledRsuiteData(nextControlledRsuiteData)}),[customSearchMinQueryLength,optionValueKey,rsuiteData]),renderMenuItem=(0,react.useCallback)((node=>(0,jsx_runtime.jsx)("span",{title:String(node),children:String(node)})),[]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassName,style,children:[(0,jsx_runtime.jsx)(Label,{disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(CheckPicker_Box,{ref:boxRef,$hasError:hasError,$isLight:isLight,children:boxRef.current&&(0,jsx_runtime.jsx)(CheckPicker.Z,{container:boxRef.current,data:controlledRsuiteData??rsuiteData,disabled,id:originalProps.name,onChange:handleChange,onSearch:handleSearch,renderMenuItem,searchable:!!customSearch||searchable,searchBy:customSearch?()=>!0:void 0,size:originalProps.size??"sm",value:selectedRsuiteValue,...originalProps},key)}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}CheckPicker_CheckPicker.displayName="CheckPicker";const CheckPicker_Box=styled_components_browser_esm.ZP.div` position: relative; user-select: none; width: 100%; @@ -866,7 +866,7 @@ } } } -`;try{CheckPicker_CheckPicker.displayName="CheckPicker",CheckPicker_CheckPicker.__docgenInfo={description:"",displayName:"CheckPicker",props:{customSearch:{defaultValue:null,description:"",name:"customSearch",required:!1,type:{name:"CustomSearch>"}},customSearchMinQueryLength:{defaultValue:{value:"1"},description:"Minimum search query length required to trigger custom search filtering.",name:"customSearchMinQueryLength",required:!1,type:{name:"number"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue[]) => Promisable)"}},optionValueKey:{defaultValue:null,description:"",name:"optionValueKey",required:!1,type:{name:"string | number | symbol"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValue[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/CheckPicker.tsx#CheckPicker"]={docgenInfo:CheckPicker_CheckPicker.__docgenInfo,name:"CheckPicker",path:"src/fields/CheckPicker.tsx#CheckPicker"})}catch(__react_docgen_typescript_loader_error){}var DatePicker=__webpack_require__("./node_modules/rsuite/esm/DatePicker/index.js"),dayjs_min=__webpack_require__("./node_modules/dayjs/dayjs.min.js"),dayjs_min_default=__webpack_require__.n(dayjs_min);__webpack_require__("./node_modules/dayjs/locale/fr.js");function getUtcizedDayjs(localDate){const definedLocalDate=localDate||new Date,timezoneOffsetInMinutes=definedLocalDate.getTimezoneOffset();return dayjs_min_default()(definedLocalDate).utc().subtract(timezoneOffsetInMinutes,"minutes")}dayjs_min_default().extend(isSameOrAfter_default()),dayjs_min_default().extend(isSameOrBefore_default()),dayjs_min_default().extend(localeData_default()),dayjs_min_default().extend(quarterOfYear_default()),dayjs_min_default().extend(timezone_default()),dayjs_min_default().extend(updateLocale_default()),dayjs_min_default().extend(utc_default()),dayjs_min_default().locale("fr");new Array(24).fill(void 0).map(((_,index)=>({label:String(index).padStart(2,"0"),value:index})));const RSUITE_CALENDAR_LOCALE={formattedDayPattern:"dd/MM/yyyy",formattedMonthPattern:"MMMM yyyy",friday:"V",hours:"Heures",minutes:"Minutes",monday:"L",ok:"Valider",saturday:"S",seconds:"Secondes",sunday:"D",thursday:"J",today:"Aujourd’hui",tuesday:"M",wednesday:"M",yesterday:"Hier"};function formatNumberAsDoubleDigit(numberLike){return String(numberLike).padStart(2,"0")}function getDayjsFromUtcDateAndTimeTuple(utcDateTuple,utcTimeTuple,isEnd=!1){const[year,month,day]=utcDateTuple,[hour,minute]=utcTimeTuple,rawDateAsDayjs=dayjs_min_default()().utc().year(Number(year)).month(Number(month)-1).date(Number(day)).hour(Number(hour)).minute(Number(minute));return isEnd?rawDateAsDayjs.endOf("minute").millisecond(0):rawDateAsDayjs.startOf("minute")}function getUtcDateFromDateAndTimeTuple(dateTuple,timeTuple,isEnd=!1){const[year,month,day]=dateTuple,[hour,minute]=timeTuple,rawDateAsDayjs=dayjs_min_default()().utc().year(Number(year)).month(Number(month)-1).date(Number(day)).hour(Number(hour)).minute(Number(minute));return isEnd?rawDateAsDayjs.endOf("minute").millisecond(0).toDate():rawDateAsDayjs.startOf("minute").toDate()}function getDateTupleFromUtcDate(utcDate){if(utcDate)return[String(utcDate.getFullYear()),formatNumberAsDoubleDigit(utcDate.getMonth()+1),formatNumberAsDoubleDigit(utcDate.getDate())]}const getRangedTimeOptions=minutesRange=>{const perHourOptionsLength=60/minutesRange;return new Array(24*perHourOptionsLength).fill(void 0).map(((_,index)=>{const hour=Math.floor(index/perHourOptionsLength),minute=minutesRange*(index%perHourOptionsLength);return{label:`${String(hour).padStart(2,"0")}:${String(minute).padStart(2,"0")}`,value:[formatNumberAsDoubleDigit(hour),formatNumberAsDoubleDigit(minute)]}}))};function getUtcDateTupleFromDayjs(dateAsDayjs){if(dateAsDayjs)return[dateAsDayjs.utc().format("YYYY"),dateAsDayjs.utc().format("MM"),dateAsDayjs.utc().format("DD")]}function getUtcTimeTupleFromDayjs(dateAsDayjs){if(dateAsDayjs)return[dateAsDayjs.utc().format("HH"),dateAsDayjs.utc().format("mm")]}function isHtmlElement(element){return!!element&&Boolean(element.tagName)}function CalendarPicker({isHistorical,isOpen,onChange,value}){const boxRef=(0,react.useRef)(),{forceUpdate}=useForceUpdate(),utcTodayAsDayjs=(0,react.useMemo)((()=>dayjs_min_default()().utc().endOf("day")),[]),controlledValue=(0,react.useMemo)((()=>value?function getLocalizedDayjs(utcDate){const timezoneOffsetInMinutes=("string"==typeof utcDate?new Date(utcDate):utcDate).getTimezoneOffset();return dayjs_min_default()(utcDate).add(timezoneOffsetInMinutes,"minutes")}(value).toDate():void 0),[value]),shouldDisableDate=(0,react.useMemo)((()=>date=>!(!date||!isHistorical)&&getUtcizedDayjs(date).isAfter(utcTodayAsDayjs)),[isHistorical,utcTodayAsDayjs]),handleSelect=(0,react.useCallback)((nextLocalDate=>{const nextUtcDateTuple=getUtcDateTupleFromDayjs(getUtcizedDayjs(nextLocalDate));onChange(nextUtcDateTuple)}),[onChange]);return(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsx)(CalendarPicker_Box,{ref:boxRef,onClick:stopMouseEventPropagation.k,children:boxRef.current&&(0,jsx_runtime.jsx)(DatePicker.Z,{container:boxRef.current,format:"yyyy-MM-dd",locale:RSUITE_CALENDAR_LOCALE,oneTap:!0,onSelect:handleSelect,open:isOpen,ranges:[],shouldDisableDate,value:controlledValue??null})})}CalendarPicker.displayName="CalendarPicker";const CalendarPicker_Box=styled_components_browser_esm.ZP.div` +`;try{CheckPicker_CheckPicker.displayName="CheckPicker",CheckPicker_CheckPicker.__docgenInfo={description:"",displayName:"CheckPicker",props:{customSearch:{defaultValue:null,description:"",name:"customSearch",required:!1,type:{name:"CustomSearch>"}},customSearchMinQueryLength:{defaultValue:{value:"1"},description:"Minimum search query length required to trigger custom search filtering.",name:"customSearchMinQueryLength",required:!1,type:{name:"number"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue[]) => Promisable)"}},optionValueKey:{defaultValue:null,description:"",name:"optionValueKey",required:!1,type:{name:"string | number | symbol"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValue[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/CheckPicker.tsx#CheckPicker"]={docgenInfo:CheckPicker_CheckPicker.__docgenInfo,name:"CheckPicker",path:"src/fields/CheckPicker.tsx#CheckPicker"})}catch(__react_docgen_typescript_loader_error){}var DatePicker=__webpack_require__("./node_modules/rsuite/esm/DatePicker/index.js"),dayjs_min=__webpack_require__("./node_modules/dayjs/dayjs.min.js"),dayjs_min_default=__webpack_require__.n(dayjs_min);__webpack_require__("./node_modules/dayjs/locale/fr.js");function getUtcizedDayjs(localDate){const definedLocalDate=localDate??new Date,timezoneOffsetInMinutes=definedLocalDate.getTimezoneOffset();return dayjs_min_default()(definedLocalDate).utc().subtract(timezoneOffsetInMinutes,"minutes")}dayjs_min_default().extend(isSameOrAfter_default()),dayjs_min_default().extend(isSameOrBefore_default()),dayjs_min_default().extend(localeData_default()),dayjs_min_default().extend(quarterOfYear_default()),dayjs_min_default().extend(timezone_default()),dayjs_min_default().extend(updateLocale_default()),dayjs_min_default().extend(utc_default()),dayjs_min_default().locale("fr");new Array(24).fill(void 0).map(((_,index)=>({label:String(index).padStart(2,"0"),value:index})));const RSUITE_CALENDAR_LOCALE={formattedDayPattern:"dd/MM/yyyy",formattedMonthPattern:"MMMM yyyy",friday:"V",hours:"Heures",minutes:"Minutes",monday:"L",ok:"Valider",saturday:"S",seconds:"Secondes",sunday:"D",thursday:"J",today:"Aujourd’hui",tuesday:"M",wednesday:"M",yesterday:"Hier"};function formatNumberAsDoubleDigit(numberLike){return String(numberLike).padStart(2,"0")}function getDayjsFromUtcDateAndTimeTuple(utcDateTuple,utcTimeTuple,isEnd=!1){const[year,month,day]=utcDateTuple,[hour,minute]=utcTimeTuple,rawDateAsDayjs=dayjs_min_default()().utc().year(Number(year)).month(Number(month)-1).date(Number(day)).hour(Number(hour)).minute(Number(minute));return isEnd?rawDateAsDayjs.endOf("minute").millisecond(0):rawDateAsDayjs.startOf("minute")}function getUtcDateFromDateAndTimeTuple(dateTuple,timeTuple,isEnd=!1){const[year,month,day]=dateTuple,[hour,minute]=timeTuple,rawDateAsDayjs=dayjs_min_default()().utc().year(Number(year)).month(Number(month)-1).date(Number(day)).hour(Number(hour)).minute(Number(minute));return isEnd?rawDateAsDayjs.endOf("minute").millisecond(0).toDate():rawDateAsDayjs.startOf("minute").toDate()}function getDateTupleFromUtcDate(utcDate){if(utcDate)return[String(utcDate.getFullYear()),formatNumberAsDoubleDigit(utcDate.getMonth()+1),formatNumberAsDoubleDigit(utcDate.getDate())]}const getRangedTimeOptions=minutesRange=>{const perHourOptionsLength=60/minutesRange;return new Array(24*perHourOptionsLength).fill(void 0).map(((_,index)=>{const hour=Math.floor(index/perHourOptionsLength),minute=minutesRange*(index%perHourOptionsLength);return{label:`${String(hour).padStart(2,"0")}:${String(minute).padStart(2,"0")}`,value:[formatNumberAsDoubleDigit(hour),formatNumberAsDoubleDigit(minute)]}}))};function getUtcDateTupleFromDayjs(dateAsDayjs){if(dateAsDayjs)return[dateAsDayjs.utc().format("YYYY"),dateAsDayjs.utc().format("MM"),dateAsDayjs.utc().format("DD")]}function getUtcTimeTupleFromDayjs(dateAsDayjs){if(dateAsDayjs)return[dateAsDayjs.utc().format("HH"),dateAsDayjs.utc().format("mm")]}function isHtmlElement(element){return!!element&&Boolean(element.tagName)}function CalendarPicker({isHistorical,isOpen,onChange,value}){const boxRef=(0,react.useRef)(),{forceUpdate}=useForceUpdate(),utcTodayAsDayjs=(0,react.useMemo)((()=>dayjs_min_default()().utc().endOf("day")),[]),controlledValue=(0,react.useMemo)((()=>value?function getLocalizedDayjs(utcDate){const timezoneOffsetInMinutes=("string"==typeof utcDate?new Date(utcDate):utcDate).getTimezoneOffset();return dayjs_min_default()(utcDate).add(timezoneOffsetInMinutes,"minutes")}(value).toDate():void 0),[value]),shouldDisableDate=(0,react.useMemo)((()=>date=>!(!date||!isHistorical)&&getUtcizedDayjs(date).isAfter(utcTodayAsDayjs)),[isHistorical,utcTodayAsDayjs]),handleSelect=(0,react.useCallback)((nextLocalDate=>{const nextUtcDateTuple=getUtcDateTupleFromDayjs(getUtcizedDayjs(nextLocalDate));onChange(nextUtcDateTuple)}),[onChange]);return(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsx)(CalendarPicker_Box,{ref:boxRef,onClick:stopMouseEventPropagation.k,children:boxRef.current&&(0,jsx_runtime.jsx)(DatePicker.Z,{container:boxRef.current,format:"yyyy-MM-dd",locale:RSUITE_CALENDAR_LOCALE,oneTap:!0,onSelect:handleSelect,open:isOpen,ranges:[],shouldDisableDate,value:controlledValue??null})})}CalendarPicker.displayName="CalendarPicker";const CalendarPicker_Box=styled_components_browser_esm.ZP.div` height: 0; position: relative; user-select: none; @@ -1120,7 +1120,7 @@ > div:nth-child(2) { margin: 2px 0 0 16px; } -`;try{TimeInput.displayName="TimeInput",TimeInput.__docgenInfo={description:"",displayName:"TimeInput",props:{onBack:{defaultValue:null,description:"Called when the use press backspace key while the input is empty.",name:"onBack",required:!1,type:{name:"(() => Promisable)"}},onPrevious:{defaultValue:null,description:"Called when the left arrow is pressed while the cursor is positionned at the input start.",name:"onPrevious",required:!1,type:{name:"((() => Promisable) & (() => Promisable))"}},onNext:{defaultValue:null,description:"Called when the right arrow is pressed while the cursor is positionned at the input end.",name:"onNext",required:!1,type:{name:"((() => Promisable) & (() => Promisable))"}},baseContainer:{defaultValue:null,description:"",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!0,type:{name:"boolean"}},isCompact:{defaultValue:null,description:"",name:"isCompact",required:!0,type:{name:"boolean"}},isEndDate:{defaultValue:null,description:"",name:"isEndDate",required:!1,type:{name:"boolean"}},isLight:{defaultValue:null,description:"",name:"isLight",required:!0,type:{name:"boolean"}},isStartDate:{defaultValue:null,description:"",name:"isStartDate",required:!1,type:{name:"boolean"}},minutesRange:{defaultValue:null,description:"",name:"minutesRange",required:!1,type:{name:"number"}},onChange:{defaultValue:null,description:"Called each time any time input is changed to a new valid value.",name:"onChange",required:!0,type:{name:"(nextTimeTuple: TimeTuple) => Promisable"}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"(() => Promisable)"}},onInput:{defaultValue:null,description:"Called each time any time input receive a keyboard-input change whether the value is valid or not.",name:"onInput",required:!0,type:{name:"() => Promisable"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"TimeTuple"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/DateRangePicker/TimeInput.tsx#TimeInput"]={docgenInfo:TimeInput.__docgenInfo,name:"TimeInput",path:"src/fields/DateRangePicker/TimeInput.tsx#TimeInput"})}catch(__react_docgen_typescript_loader_error){}function DatePicker_DatePicker({baseContainer,className,defaultValue,disabled=!1,error,isCompact=!1,isEndDate=!1,isErrorMessageHidden=!1,isHistorical=!1,isLabelHidden=!1,isLight=!1,isStringDate=!1,isUndefinedWhenDisabled=!1,label,minutesRange=15,onChange,style,withTime=!1,...nativeProps}){const boxRef=(0,react.useRef)(null),dateInputRef=(0,react.useRef)(null),timeInputRef=(0,react.useRef)(null),hasMountedRef=(0,react.useRef)(!1),selectedUtcDateAsDayjsRef=(0,react.useRef)(defaultValue?dayjs_min_default()(defaultValue):void 0),selectedUtcDateTupleRef=(0,react.useRef)(getUtcDateTupleFromDayjs(selectedUtcDateAsDayjsRef.current)),selectedUtcTimeTupleRef=(0,react.useRef)(getUtcTimeTupleFromDayjs(selectedUtcDateAsDayjsRef.current)),[isRangeCalendarPickerOpen,setIsRangeCalendarPickerOpen]=(0,react.useState)(!1),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-DatePicker",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),defaultTimeTuple=(0,react.useMemo)((()=>isEndDate?["23","59"]:["00","00"]),[isEndDate]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),previousDefaultValue=usePrevious_usePrevious(defaultValue),{forceUpdate}=useForceUpdate(),calendarPickerDefaultValue=(0,react.useMemo)((()=>selectedUtcDateTupleRef.current?getUtcDateFromDateAndTimeTuple(selectedUtcDateTupleRef.current,defaultTimeTuple):void 0),[selectedUtcDateTupleRef.current]),callOnChange=(0,react.useCallback)((()=>{if(!onChange||!selectedUtcDateAsDayjsRef.current)return;const nextDateAsDayjs=selectedUtcDateAsDayjsRef.current;onChange(isStringDate?nextDateAsDayjs.toISOString():nextDateAsDayjs.toDate())}),[isStringDate,onChange]),callOnChangeUndefinedIfInputsAreEmpty=(0,react.useCallback)((()=>{if(!dateInputRef.current||!onChange)return;const[year,month,day]=dateInputRef.current.getValueAsPartialDateTuple();if(!(withTime||year||month||day))return void onChange(void 0);if(!timeInputRef.current)return;const[hour,minute]=timeInputRef.current.getValueAsPartialTimeTuple();year||month||day||hour||minute||onChange(void 0)}),[onChange,withTime]),closeCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!1)}),[]),handleDateInputNext=(0,react.useCallback)((()=>{withTime&&timeInputRef.current&&timeInputRef.current.focus()}),[withTime]),handleDateInputChange=(0,react.useCallback)(((nextUtcDateTuple,isFilled)=>{if(selectedUtcDateTupleRef.current=nextUtcDateTuple,!withTime||withTime&&selectedUtcTimeTupleRef.current){const timeTuple=withTime&&selectedUtcTimeTupleRef.current?selectedUtcTimeTupleRef.current:defaultTimeTuple;selectedUtcDateAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextUtcDateTuple,timeTuple,isEndDate),callOnChange()}isFilled&&handleDateInputNext()}),[callOnChange,defaultTimeTuple,handleDateInputNext,isEndDate,withTime]),handleCalendarPickerChange=(0,react.useCallback)((nextUtcizedDateTuple=>{withTime?selectedUtcTimeTupleRef.current&&(selectedUtcDateAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextUtcizedDateTuple,selectedUtcTimeTupleRef.current,isEndDate)):selectedUtcDateAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextUtcizedDateTuple,defaultTimeTuple,isEndDate),selectedUtcDateTupleRef.current=nextUtcizedDateTuple,selectedUtcTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedUtcDateAsDayjsRef.current),closeCalendarPicker(),forceUpdate(),callOnChange(),withTime&&timeInputRef.current&&timeInputRef.current.focus()}),[callOnChange,closeCalendarPicker,defaultTimeTuple,forceUpdate,isEndDate,withTime]),handleDisable=(0,react.useCallback)((()=>{selectedUtcDateTupleRef.current=void 0,selectedUtcTimeTupleRef.current=void 0,forceUpdate()}),[forceUpdate]),handleTimeInputChange=(0,react.useCallback)((nextTimeTuple=>{if(selectedUtcDateTupleRef.current){const nextDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(selectedUtcDateTupleRef.current,nextTimeTuple);selectedUtcDateAsDayjsRef.current=nextDateAsDayjs}selectedUtcTimeTupleRef.current=nextTimeTuple,callOnChange()}),[callOnChange]),openCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!0)}),[]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange,handleDisable),useClickOutsideEffect(boxRef,closeCalendarPicker,baseContainer),(0,react.useEffect)((()=>{hasMountedRef.current?defaultValue instanceof Date&&previousDefaultValue instanceof Date&&defaultValue.toISOString()===previousDefaultValue.toISOString()||defaultValue===previousDefaultValue||(selectedUtcDateAsDayjsRef.current=defaultValue?dayjs_min_default()(defaultValue):void 0,selectedUtcDateTupleRef.current=getUtcDateTupleFromDayjs(selectedUtcDateAsDayjsRef.current),selectedUtcTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedUtcDateAsDayjsRef.current),forceUpdate()):hasMountedRef.current=!0}),[defaultValue,forceUpdate,previousDefaultValue]),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,legend:label,style,...nativeProps,children:[(0,jsx_runtime.jsxs)(DatePicker_Box,{ref:boxRef,$hasError:hasError,$isDisabled:disabled,children:[(0,jsx_runtime.jsx)(DatePicker_Field,{children:(0,jsx_runtime.jsx)(DateInput,{ref:dateInputRef,baseContainer:baseContainer||void 0,disabled,isCompact,isEndDate,isForcedFocused:isRangeCalendarPickerOpen,isLight,onChange:handleDateInputChange,onClick:openCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:handleDateInputNext,value:selectedUtcDateTupleRef.current})}),withTime&&(0,jsx_runtime.jsx)(DatePicker_Field,{$isTimeField:!0,children:(0,jsx_runtime.jsx)(TimeInput,{ref:timeInputRef,baseContainer:baseContainer||void 0,disabled,isCompact,isLight,minutesRange,onBack:()=>dateInputRef.current?.focus(!0),onChange:handleTimeInputChange,onFocus:closeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onPrevious:()=>dateInputRef.current?.focus(!0),value:selectedUtcTimeTupleRef.current})})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError}),(0,jsx_runtime.jsx)(CalendarPicker,{isHistorical,isOpen:isRangeCalendarPickerOpen,onChange:handleCalendarPickerChange,value:calendarPickerDefaultValue})]})}DatePicker_DatePicker.displayName="DatePicker";const DatePicker_Box=styled_components_browser_esm.ZP.div` +`;try{TimeInput.displayName="TimeInput",TimeInput.__docgenInfo={description:"",displayName:"TimeInput",props:{onBack:{defaultValue:null,description:"Called when the use press backspace key while the input is empty.",name:"onBack",required:!1,type:{name:"(() => Promisable)"}},onPrevious:{defaultValue:null,description:"Called when the left arrow is pressed while the cursor is positionned at the input start.",name:"onPrevious",required:!1,type:{name:"((() => Promisable) & (() => Promisable))"}},onNext:{defaultValue:null,description:"Called when the right arrow is pressed while the cursor is positionned at the input end.",name:"onNext",required:!1,type:{name:"((() => Promisable) & (() => Promisable))"}},baseContainer:{defaultValue:null,description:"",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document"}},disabled:{defaultValue:null,description:"",name:"disabled",required:!0,type:{name:"boolean"}},isCompact:{defaultValue:null,description:"",name:"isCompact",required:!0,type:{name:"boolean"}},isEndDate:{defaultValue:null,description:"",name:"isEndDate",required:!1,type:{name:"boolean"}},isLight:{defaultValue:null,description:"",name:"isLight",required:!0,type:{name:"boolean"}},isStartDate:{defaultValue:null,description:"",name:"isStartDate",required:!1,type:{name:"boolean"}},minutesRange:{defaultValue:null,description:"",name:"minutesRange",required:!1,type:{name:"number"}},onChange:{defaultValue:null,description:"Called each time any time input is changed to a new valid value.",name:"onChange",required:!0,type:{name:"(nextTimeTuple: TimeTuple) => Promisable"}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"(() => Promisable)"}},onInput:{defaultValue:null,description:"Called each time any time input receive a keyboard-input change whether the value is valid or not.",name:"onInput",required:!0,type:{name:"() => Promisable"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"TimeTuple"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/DateRangePicker/TimeInput.tsx#TimeInput"]={docgenInfo:TimeInput.__docgenInfo,name:"TimeInput",path:"src/fields/DateRangePicker/TimeInput.tsx#TimeInput"})}catch(__react_docgen_typescript_loader_error){}function DatePicker_DatePicker({baseContainer,className,defaultValue,disabled=!1,error,isCompact=!1,isEndDate=!1,isErrorMessageHidden=!1,isHistorical=!1,isLabelHidden=!1,isLight=!1,isStringDate=!1,isUndefinedWhenDisabled=!1,label,minutesRange=15,onChange,style,withTime=!1,...nativeProps}){const boxRef=(0,react.useRef)(null),dateInputRef=(0,react.useRef)(null),timeInputRef=(0,react.useRef)(null),hasMountedRef=(0,react.useRef)(!1),selectedUtcDateAsDayjsRef=(0,react.useRef)(defaultValue?dayjs_min_default()(defaultValue):void 0),selectedUtcDateTupleRef=(0,react.useRef)(getUtcDateTupleFromDayjs(selectedUtcDateAsDayjsRef.current)),selectedUtcTimeTupleRef=(0,react.useRef)(getUtcTimeTupleFromDayjs(selectedUtcDateAsDayjsRef.current)),[isRangeCalendarPickerOpen,setIsRangeCalendarPickerOpen]=(0,react.useState)(!1),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-DatePicker",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),defaultTimeTuple=(0,react.useMemo)((()=>isEndDate?["23","59"]:["00","00"]),[isEndDate]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),previousDefaultValue=usePrevious_usePrevious(defaultValue),{forceUpdate}=useForceUpdate(),calendarPickerDefaultValue=(0,react.useMemo)((()=>selectedUtcDateTupleRef.current?getUtcDateFromDateAndTimeTuple(selectedUtcDateTupleRef.current,defaultTimeTuple):void 0),[selectedUtcDateTupleRef.current]),callOnChange=(0,react.useCallback)((()=>{if(!onChange||!selectedUtcDateAsDayjsRef.current)return;const nextDateAsDayjs=selectedUtcDateAsDayjsRef.current;onChange(isStringDate?nextDateAsDayjs.toISOString():nextDateAsDayjs.toDate())}),[isStringDate,onChange]),callOnChangeUndefinedIfInputsAreEmpty=(0,react.useCallback)((()=>{if(!dateInputRef.current||!onChange)return;const[year,month,day]=dateInputRef.current.getValueAsPartialDateTuple();if(!(withTime||year||month||day))return void onChange(void 0);if(!timeInputRef.current)return;const[hour,minute]=timeInputRef.current.getValueAsPartialTimeTuple();year||month||day||hour||minute||onChange(void 0)}),[onChange,withTime]),closeCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!1)}),[]),handleDateInputNext=(0,react.useCallback)((()=>{withTime&&timeInputRef.current&&timeInputRef.current.focus()}),[withTime]),handleDateInputChange=(0,react.useCallback)(((nextUtcDateTuple,isFilled)=>{if(selectedUtcDateTupleRef.current=nextUtcDateTuple,!withTime||withTime&&selectedUtcTimeTupleRef.current){const timeTuple=withTime&&selectedUtcTimeTupleRef.current?selectedUtcTimeTupleRef.current:defaultTimeTuple;selectedUtcDateAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextUtcDateTuple,timeTuple,isEndDate),callOnChange()}isFilled&&handleDateInputNext()}),[callOnChange,defaultTimeTuple,handleDateInputNext,isEndDate,withTime]),handleCalendarPickerChange=(0,react.useCallback)((nextUtcizedDateTuple=>{withTime?selectedUtcTimeTupleRef.current&&(selectedUtcDateAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextUtcizedDateTuple,selectedUtcTimeTupleRef.current,isEndDate)):selectedUtcDateAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextUtcizedDateTuple,defaultTimeTuple,isEndDate),selectedUtcDateTupleRef.current=nextUtcizedDateTuple,selectedUtcTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedUtcDateAsDayjsRef.current),closeCalendarPicker(),forceUpdate(),callOnChange(),withTime&&timeInputRef.current&&timeInputRef.current.focus()}),[callOnChange,closeCalendarPicker,defaultTimeTuple,forceUpdate,isEndDate,withTime]),handleDisable=(0,react.useCallback)((()=>{selectedUtcDateTupleRef.current=void 0,selectedUtcTimeTupleRef.current=void 0,forceUpdate()}),[forceUpdate]),handleTimeInputChange=(0,react.useCallback)((nextTimeTuple=>{if(selectedUtcDateTupleRef.current){const nextDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(selectedUtcDateTupleRef.current,nextTimeTuple);selectedUtcDateAsDayjsRef.current=nextDateAsDayjs}selectedUtcTimeTupleRef.current=nextTimeTuple,callOnChange()}),[callOnChange]),openCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!0)}),[]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange,handleDisable),useClickOutsideEffect(boxRef,closeCalendarPicker,baseContainer),(0,react.useEffect)((()=>{hasMountedRef.current?defaultValue instanceof Date&&previousDefaultValue instanceof Date&&defaultValue.toISOString()===previousDefaultValue.toISOString()||defaultValue===previousDefaultValue||(selectedUtcDateAsDayjsRef.current=defaultValue?dayjs_min_default()(defaultValue):void 0,selectedUtcDateTupleRef.current=getUtcDateTupleFromDayjs(selectedUtcDateAsDayjsRef.current),selectedUtcTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedUtcDateAsDayjsRef.current),forceUpdate()):hasMountedRef.current=!0}),[defaultValue,forceUpdate,previousDefaultValue]),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,legend:label,style,...nativeProps,children:[(0,jsx_runtime.jsxs)(DatePicker_Box,{ref:boxRef,$hasError:hasError,$isDisabled:disabled,children:[(0,jsx_runtime.jsx)(DatePicker_Field,{children:(0,jsx_runtime.jsx)(DateInput,{ref:dateInputRef,baseContainer:baseContainer??void 0,disabled,isCompact,isEndDate,isForcedFocused:isRangeCalendarPickerOpen,isLight,onChange:handleDateInputChange,onClick:openCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:handleDateInputNext,value:selectedUtcDateTupleRef.current})}),withTime&&(0,jsx_runtime.jsx)(DatePicker_Field,{$isTimeField:!0,children:(0,jsx_runtime.jsx)(TimeInput,{ref:timeInputRef,baseContainer:baseContainer??void 0,disabled,isCompact,isLight,minutesRange,onBack:()=>dateInputRef.current?.focus(!0),onChange:handleTimeInputChange,onFocus:closeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onPrevious:()=>dateInputRef.current?.focus(!0),value:selectedUtcTimeTupleRef.current})})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError}),(0,jsx_runtime.jsx)(CalendarPicker,{isHistorical,isOpen:isRangeCalendarPickerOpen,onChange:handleCalendarPickerChange,value:calendarPickerDefaultValue})]})}DatePicker_DatePicker.displayName="DatePicker";const DatePicker_Box=styled_components_browser_esm.ZP.div` * { font-weight: 500; line-height: 1; @@ -1306,7 +1306,7 @@ } } } -`;try{RangeCalendarPicker.displayName="RangeCalendarPicker",RangeCalendarPicker.__docgenInfo={description:"",displayName:"RangeCalendarPicker",props:{defaultValue:{defaultValue:null,description:"@description We expect a UTC Date range here and NOT a utcized one.\n\nThe order between the start and end date doesn't matter since it's sorted internally.",name:"defaultValue",required:!1,type:{name:"DateRange"}},hasSingleCalendar:{defaultValue:{value:"false"},description:"",name:"hasSingleCalendar",required:!1,type:{name:"boolean"}},isHistorical:{defaultValue:null,description:"",name:"isHistorical",required:!1,type:{name:"boolean"}},isOpen:{defaultValue:null,description:"",name:"isOpen",required:!0,type:{name:"boolean"}},onChange:{defaultValue:null,description:"@description Note that `nextUtcdDateTupleRange` is ALREADY utized from the user pick.",name:"onChange",required:!0,type:{name:"(nextUtcDateTupleRange: DateTupleRange) => Promisable"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/DateRangePicker/RangeCalendarPicker.tsx#RangeCalendarPicker"]={docgenInfo:RangeCalendarPicker.__docgenInfo,name:"RangeCalendarPicker",path:"src/fields/DateRangePicker/RangeCalendarPicker.tsx#RangeCalendarPicker"})}catch(__react_docgen_typescript_loader_error){}let DateRangePosition=function(DateRangePosition){return DateRangePosition.END="END",DateRangePosition.START="START",DateRangePosition}({});function DateRangePicker_DateRangePicker({baseContainer,className,defaultValue,disabled=!1,error,hasSingleCalendar=!1,isCompact=!1,isErrorMessageHidden=!1,isHistorical=!1,isLabelHidden=!1,isLight=!1,isStringDate=!1,isUndefinedWhenDisabled=!1,label,minutesRange=15,onChange,style,withTime=!1,...nativeProps}){const startDateInputRef=(0,react.useRef)(null),startTimeInputRef=(0,react.useRef)(null),endDateInputRef=(0,react.useRef)(null),endTimeInputRef=(0,react.useRef)(null),hasMountedRef=(0,react.useRef)(!1),selectedStartDateTimeAsDayjsRef=(0,react.useRef)(defaultValue?dayjs_min_default()(defaultValue[0]):void 0),selectedStartDateTupleRef=(0,react.useRef)(getUtcDateTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current)),selectedStartTimeTupleRef=(0,react.useRef)(getUtcTimeTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current)),selectedEndDateTimeAsDayjsRef=(0,react.useRef)(defaultValue?dayjs_min_default()(defaultValue[1]):void 0),selectedEndDateTupleRef=(0,react.useRef)(getUtcDateTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current)),selectedEndTimeTupleRef=(0,react.useRef)(getUtcTimeTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current)),[isRangeCalendarPickerOpen,setIsRangeCalendarPickerOpen]=(0,react.useState)(!1),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-DateRangePicker",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),previousDefaultValue=usePrevious_usePrevious(defaultValue),{forceUpdate}=useForceUpdate(),rangeCalendarPickerDefaultValue=(0,react.useMemo)((()=>selectedStartDateTupleRef.current&&selectedEndDateTupleRef.current?[getUtcDateFromDateAndTimeTuple(selectedStartDateTupleRef.current,["00","00"]),getUtcDateFromDateAndTimeTuple(selectedEndDateTupleRef.current,["00","00"],!0)]:void 0),[selectedEndDateTupleRef.current,selectedStartDateTupleRef.current]),callOnChange=(0,react.useCallback)((()=>{if(!onChange||!selectedStartDateTimeAsDayjsRef.current||!selectedEndDateTimeAsDayjsRef.current)return;if(isStringDate){const startUtcDateAsString=selectedStartDateTimeAsDayjsRef.current.utc().toISOString(),endUtcDateAsString=selectedEndDateTimeAsDayjsRef.current.utc().toISOString();return void onChange([startUtcDateAsString,endUtcDateAsString])}const startUtcDate=selectedStartDateTimeAsDayjsRef.current.toDate(),endUtcDate=selectedEndDateTimeAsDayjsRef.current.toDate();onChange([startUtcDate,endUtcDate])}),[isStringDate,onChange]),callOnChangeUndefinedIfInputsAreEmpty=(0,react.useCallback)((()=>{if(!startDateInputRef.current||!endDateInputRef.current||!onChange)return;const[startYear,startMonth,startDay]=startDateInputRef.current.getValueAsPartialDateTuple(),[endYear,endMonth,endDay]=endDateInputRef.current.getValueAsPartialDateTuple();if(!(withTime||startYear||startMonth||startDay||endYear||endMonth||endDay))return void onChange(void 0);if(!startTimeInputRef.current||!endTimeInputRef.current)return;const[startHour,startMinute]=startTimeInputRef.current.getValueAsPartialTimeTuple(),[endHour,endMinute]=endTimeInputRef.current.getValueAsPartialTimeTuple();startYear||startMonth||startDay||startHour||startMinute||endYear||endMonth||endDay||endHour||endMinute||onChange(void 0)}),[onChange,withTime]),closeRangeCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!1)}),[]),handleDisable=(0,react.useCallback)((()=>{selectedStartDateTupleRef.current=void 0,selectedStartTimeTupleRef.current=void 0,selectedEndDateTupleRef.current=void 0,selectedEndTimeTupleRef.current=void 0,forceUpdate()}),[forceUpdate]),handleEndDateInputNext=(0,react.useCallback)((()=>{withTime&&endTimeInputRef.current&&endTimeInputRef.current.focus()}),[withTime]),handleEndDateInputPrevious=(0,react.useCallback)((()=>{startDateInputRef.current&&(withTime&&startTimeInputRef.current?startTimeInputRef.current.focus(!0):startDateInputRef.current.focus(!0))}),[withTime]),handleStartDateInputNext=(0,react.useCallback)((()=>{endDateInputRef.current&&(withTime&&startTimeInputRef.current?startTimeInputRef.current.focus():endDateInputRef.current.focus())}),[withTime]),handleDateInputChange=(0,react.useCallback)(((position,nextDateTuple,isFilled)=>{if(position===DateRangePosition.START){if(selectedStartDateTupleRef.current=nextDateTuple,!withTime||withTime&&selectedStartTimeTupleRef.current){const nextStartDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(nextDateTuple,withTime&&selectedStartTimeTupleRef.current?selectedStartTimeTupleRef.current:["00","00"]);selectedStartDateTimeAsDayjsRef.current=nextStartDateAsDayjs,callOnChange()}isFilled&&handleStartDateInputNext()}else{if(selectedEndDateTupleRef.current=nextDateTuple,!withTime||withTime&&selectedEndTimeTupleRef.current){const nextEndDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(nextDateTuple,withTime?selectedEndTimeTupleRef.current:["23","59"],!0);selectedEndDateTimeAsDayjsRef.current=nextEndDateAsDayjs,callOnChange()}isFilled&&handleEndDateInputNext()}}),[callOnChange,handleEndDateInputNext,handleStartDateInputNext,withTime]),handleRangeCalendarPickerChange=(0,react.useCallback)((nextUtcDateTupleRange=>{const[nextStartUtcDateTuple,nextEndUtcDateTuple]=nextUtcDateTupleRange;withTime?(selectedStartTimeTupleRef.current&&selectedEndTimeTupleRef.current&&(selectedStartDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextStartUtcDateTuple,selectedStartTimeTupleRef.current),selectedEndDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextEndUtcDateTuple,selectedEndTimeTupleRef.current,!0)),startTimeInputRef.current?.focus()):(selectedStartDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextStartUtcDateTuple,["00","00"]),selectedEndDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextEndUtcDateTuple,["23","59"],!0)),selectedStartDateTupleRef.current=nextStartUtcDateTuple,selectedStartTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current),selectedEndDateTupleRef.current=nextEndUtcDateTuple,selectedEndTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current),closeRangeCalendarPicker(),callOnChange()}),[callOnChange,closeRangeCalendarPicker,withTime]),handleTimeInputChange=(0,react.useCallback)(((position,nextTimeTuple)=>{if(endDateInputRef.current){if(position===DateRangePosition.START){if(selectedStartDateTupleRef.current){const nextStartDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(selectedStartDateTupleRef.current,nextTimeTuple);selectedStartDateTimeAsDayjsRef.current=nextStartDateAsDayjs}selectedStartTimeTupleRef.current=nextTimeTuple}else{if(selectedEndDateTupleRef.current){const nextEndDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(selectedEndDateTupleRef.current,nextTimeTuple,!0);selectedEndDateTimeAsDayjsRef.current=nextEndDateAsDayjs}selectedEndTimeTupleRef.current=nextTimeTuple}callOnChange()}}),[callOnChange]),openRangeCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!0)}),[]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange,handleDisable),useClickOutsideEffect([endDateInputRef,startDateInputRef],closeRangeCalendarPicker,baseContainer),(0,react.useEffect)((()=>{hasMountedRef.current?defaultValue&&previousDefaultValue&&defaultValue[0]instanceof Date&&defaultValue[1]instanceof Date&&previousDefaultValue[0]instanceof Date&&previousDefaultValue[1]instanceof Date&&defaultValue[0].toISOString()===previousDefaultValue[0].toISOString()&&defaultValue[1].toISOString()===previousDefaultValue[1].toISOString()||(0,lodash.isEqual)(defaultValue,previousDefaultValue)||(selectedStartDateTimeAsDayjsRef.current=defaultValue?dayjs_min_default()(defaultValue[0]):void 0,selectedEndDateTimeAsDayjsRef.current=defaultValue?dayjs_min_default()(defaultValue[1]):void 0,selectedStartDateTupleRef.current=getUtcDateTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current),selectedEndDateTupleRef.current=getUtcDateTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current),selectedStartTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current),selectedEndTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current),forceUpdate()):hasMountedRef.current=!0}),[defaultValue,forceUpdate,previousDefaultValue]),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,legend:label,style,...nativeProps,children:[(0,jsx_runtime.jsxs)(DateRangePicker_Box,{$hasError:hasError,$isDisabled:disabled,children:[(0,jsx_runtime.jsx)(DateRangePicker_Field,{children:(0,jsx_runtime.jsx)(DateInput,{ref:startDateInputRef,baseContainer:baseContainer||void 0,disabled,isCompact,isForcedFocused:isRangeCalendarPickerOpen,isLight,isRange:!0,isStartDate:!0,onChange:(nextDateTuple,isFilled)=>handleDateInputChange(DateRangePosition.START,nextDateTuple,isFilled),onClick:openRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:handleStartDateInputNext,value:selectedStartDateTupleRef.current})}),withTime&&(0,jsx_runtime.jsx)(DateRangePicker_Field,{isTimeField:!0,children:(0,jsx_runtime.jsx)(TimeInput,{ref:startTimeInputRef,baseContainer:baseContainer||void 0,disabled,isCompact,isLight,isStartDate:!0,minutesRange,onBack:()=>startDateInputRef.current?.focus(!0),onChange:nextTimeTuple=>handleTimeInputChange(DateRangePosition.START,nextTimeTuple),onFocus:closeRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:()=>endDateInputRef.current?.focus(),onPrevious:()=>startDateInputRef.current?.focus(!0),value:selectedStartTimeTupleRef.current})}),(0,jsx_runtime.jsx)(DateRangePicker_Field,{isEndDateField:!0,children:(0,jsx_runtime.jsx)(DateInput,{ref:endDateInputRef,baseContainer:baseContainer||void 0,disabled,isCompact,isEndDate:!0,isForcedFocused:isRangeCalendarPickerOpen,isLight,isRange:!0,onBack:handleEndDateInputPrevious,onChange:(nextDateTuple,isFilled)=>handleDateInputChange(DateRangePosition.END,nextDateTuple,isFilled),onClick:openRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:handleEndDateInputNext,onPrevious:handleEndDateInputPrevious,value:selectedEndDateTupleRef.current})}),withTime&&(0,jsx_runtime.jsx)(DateRangePicker_Field,{isTimeField:!0,children:(0,jsx_runtime.jsx)(TimeInput,{ref:endTimeInputRef,baseContainer:baseContainer||void 0,disabled,isCompact,isEndDate:!0,isLight,minutesRange,onBack:()=>endDateInputRef.current?.focus(!0),onChange:nextTimeTuple=>handleTimeInputChange(DateRangePosition.END,nextTimeTuple),onFocus:closeRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onPrevious:()=>endDateInputRef.current?.focus(!0),value:selectedEndTimeTupleRef.current})})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError}),(0,jsx_runtime.jsx)(RangeCalendarPicker,{defaultValue:rangeCalendarPickerDefaultValue,hasSingleCalendar,isHistorical,isOpen:isRangeCalendarPickerOpen,onChange:handleRangeCalendarPickerChange},JSON.stringify(rangeCalendarPickerDefaultValue))]})}DateRangePicker_DateRangePicker.displayName="DateRangePicker";const DateRangePicker_Box=styled_components_browser_esm.ZP.div` +`;try{RangeCalendarPicker.displayName="RangeCalendarPicker",RangeCalendarPicker.__docgenInfo={description:"",displayName:"RangeCalendarPicker",props:{defaultValue:{defaultValue:null,description:"@description We expect a UTC Date range here and NOT a utcized one.\n\nThe order between the start and end date doesn't matter since it's sorted internally.",name:"defaultValue",required:!1,type:{name:"DateRange"}},hasSingleCalendar:{defaultValue:{value:"false"},description:"",name:"hasSingleCalendar",required:!1,type:{name:"boolean"}},isHistorical:{defaultValue:null,description:"",name:"isHistorical",required:!1,type:{name:"boolean"}},isOpen:{defaultValue:null,description:"",name:"isOpen",required:!0,type:{name:"boolean"}},onChange:{defaultValue:null,description:"@description Note that `nextUtcdDateTupleRange` is ALREADY utized from the user pick.",name:"onChange",required:!0,type:{name:"(nextUtcDateTupleRange: DateTupleRange) => Promisable"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/DateRangePicker/RangeCalendarPicker.tsx#RangeCalendarPicker"]={docgenInfo:RangeCalendarPicker.__docgenInfo,name:"RangeCalendarPicker",path:"src/fields/DateRangePicker/RangeCalendarPicker.tsx#RangeCalendarPicker"})}catch(__react_docgen_typescript_loader_error){}let DateRangePosition=function(DateRangePosition){return DateRangePosition.END="END",DateRangePosition.START="START",DateRangePosition}({});function DateRangePicker_DateRangePicker({baseContainer,className,defaultValue,disabled=!1,error,hasSingleCalendar=!1,isCompact=!1,isErrorMessageHidden=!1,isHistorical=!1,isLabelHidden=!1,isLight=!1,isStringDate=!1,isUndefinedWhenDisabled=!1,label,minutesRange=15,onChange,style,withTime=!1,...nativeProps}){const startDateInputRef=(0,react.useRef)(null),startTimeInputRef=(0,react.useRef)(null),endDateInputRef=(0,react.useRef)(null),endTimeInputRef=(0,react.useRef)(null),hasMountedRef=(0,react.useRef)(!1),selectedStartDateTimeAsDayjsRef=(0,react.useRef)(defaultValue?dayjs_min_default()(defaultValue[0]):void 0),selectedStartDateTupleRef=(0,react.useRef)(getUtcDateTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current)),selectedStartTimeTupleRef=(0,react.useRef)(getUtcTimeTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current)),selectedEndDateTimeAsDayjsRef=(0,react.useRef)(defaultValue?dayjs_min_default()(defaultValue[1]):void 0),selectedEndDateTupleRef=(0,react.useRef)(getUtcDateTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current)),selectedEndTimeTupleRef=(0,react.useRef)(getUtcTimeTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current)),[isRangeCalendarPickerOpen,setIsRangeCalendarPickerOpen]=(0,react.useState)(!1),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-DateRangePicker",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),previousDefaultValue=usePrevious_usePrevious(defaultValue),{forceUpdate}=useForceUpdate(),rangeCalendarPickerDefaultValue=(0,react.useMemo)((()=>selectedStartDateTupleRef.current&&selectedEndDateTupleRef.current?[getUtcDateFromDateAndTimeTuple(selectedStartDateTupleRef.current,["00","00"]),getUtcDateFromDateAndTimeTuple(selectedEndDateTupleRef.current,["00","00"],!0)]:void 0),[selectedEndDateTupleRef.current,selectedStartDateTupleRef.current]),callOnChange=(0,react.useCallback)((()=>{if(!onChange||!selectedStartDateTimeAsDayjsRef.current||!selectedEndDateTimeAsDayjsRef.current)return;if(isStringDate){const startUtcDateAsString=selectedStartDateTimeAsDayjsRef.current.utc().toISOString(),endUtcDateAsString=selectedEndDateTimeAsDayjsRef.current.utc().toISOString();return void onChange([startUtcDateAsString,endUtcDateAsString])}const startUtcDate=selectedStartDateTimeAsDayjsRef.current.toDate(),endUtcDate=selectedEndDateTimeAsDayjsRef.current.toDate();onChange([startUtcDate,endUtcDate])}),[isStringDate,onChange]),callOnChangeUndefinedIfInputsAreEmpty=(0,react.useCallback)((()=>{if(!startDateInputRef.current||!endDateInputRef.current||!onChange)return;const[startYear,startMonth,startDay]=startDateInputRef.current.getValueAsPartialDateTuple(),[endYear,endMonth,endDay]=endDateInputRef.current.getValueAsPartialDateTuple();if(!(withTime||startYear||startMonth||startDay||endYear||endMonth||endDay))return void onChange(void 0);if(!startTimeInputRef.current||!endTimeInputRef.current)return;const[startHour,startMinute]=startTimeInputRef.current.getValueAsPartialTimeTuple(),[endHour,endMinute]=endTimeInputRef.current.getValueAsPartialTimeTuple();startYear||startMonth||startDay||startHour||startMinute||endYear||endMonth||endDay||endHour||endMinute||onChange(void 0)}),[onChange,withTime]),closeRangeCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!1)}),[]),handleDisable=(0,react.useCallback)((()=>{selectedStartDateTupleRef.current=void 0,selectedStartTimeTupleRef.current=void 0,selectedEndDateTupleRef.current=void 0,selectedEndTimeTupleRef.current=void 0,forceUpdate()}),[forceUpdate]),handleEndDateInputNext=(0,react.useCallback)((()=>{withTime&&endTimeInputRef.current&&endTimeInputRef.current.focus()}),[withTime]),handleEndDateInputPrevious=(0,react.useCallback)((()=>{startDateInputRef.current&&(withTime&&startTimeInputRef.current?startTimeInputRef.current.focus(!0):startDateInputRef.current.focus(!0))}),[withTime]),handleStartDateInputNext=(0,react.useCallback)((()=>{endDateInputRef.current&&(withTime&&startTimeInputRef.current?startTimeInputRef.current.focus():endDateInputRef.current.focus())}),[withTime]),handleDateInputChange=(0,react.useCallback)(((position,nextDateTuple,isFilled)=>{if(position===DateRangePosition.START){if(selectedStartDateTupleRef.current=nextDateTuple,!withTime||withTime&&selectedStartTimeTupleRef.current){const nextStartDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(nextDateTuple,withTime&&selectedStartTimeTupleRef.current?selectedStartTimeTupleRef.current:["00","00"]);selectedStartDateTimeAsDayjsRef.current=nextStartDateAsDayjs,callOnChange()}isFilled&&handleStartDateInputNext()}else{if(selectedEndDateTupleRef.current=nextDateTuple,!withTime||withTime&&selectedEndTimeTupleRef.current){const nextEndDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(nextDateTuple,withTime?selectedEndTimeTupleRef.current:["23","59"],!0);selectedEndDateTimeAsDayjsRef.current=nextEndDateAsDayjs,callOnChange()}isFilled&&handleEndDateInputNext()}}),[callOnChange,handleEndDateInputNext,handleStartDateInputNext,withTime]),handleRangeCalendarPickerChange=(0,react.useCallback)((nextUtcDateTupleRange=>{const[nextStartUtcDateTuple,nextEndUtcDateTuple]=nextUtcDateTupleRange;withTime?(selectedStartTimeTupleRef.current&&selectedEndTimeTupleRef.current&&(selectedStartDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextStartUtcDateTuple,selectedStartTimeTupleRef.current),selectedEndDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextEndUtcDateTuple,selectedEndTimeTupleRef.current,!0)),startTimeInputRef.current?.focus()):(selectedStartDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextStartUtcDateTuple,["00","00"]),selectedEndDateTimeAsDayjsRef.current=getDayjsFromUtcDateAndTimeTuple(nextEndUtcDateTuple,["23","59"],!0)),selectedStartDateTupleRef.current=nextStartUtcDateTuple,selectedStartTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current),selectedEndDateTupleRef.current=nextEndUtcDateTuple,selectedEndTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current),closeRangeCalendarPicker(),callOnChange()}),[callOnChange,closeRangeCalendarPicker,withTime]),handleTimeInputChange=(0,react.useCallback)(((position,nextTimeTuple)=>{if(endDateInputRef.current){if(position===DateRangePosition.START){if(selectedStartDateTupleRef.current){const nextStartDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(selectedStartDateTupleRef.current,nextTimeTuple);selectedStartDateTimeAsDayjsRef.current=nextStartDateAsDayjs}selectedStartTimeTupleRef.current=nextTimeTuple}else{if(selectedEndDateTupleRef.current){const nextEndDateAsDayjs=getDayjsFromUtcDateAndTimeTuple(selectedEndDateTupleRef.current,nextTimeTuple,!0);selectedEndDateTimeAsDayjsRef.current=nextEndDateAsDayjs}selectedEndTimeTupleRef.current=nextTimeTuple}callOnChange()}}),[callOnChange]),openRangeCalendarPicker=(0,react.useCallback)((()=>{setIsRangeCalendarPickerOpen(!0)}),[]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange,handleDisable),useClickOutsideEffect([endDateInputRef,startDateInputRef],closeRangeCalendarPicker,baseContainer),(0,react.useEffect)((()=>{hasMountedRef.current?defaultValue&&previousDefaultValue&&defaultValue[0]instanceof Date&&defaultValue[1]instanceof Date&&previousDefaultValue[0]instanceof Date&&previousDefaultValue[1]instanceof Date&&defaultValue[0].toISOString()===previousDefaultValue[0].toISOString()&&defaultValue[1].toISOString()===previousDefaultValue[1].toISOString()||(0,lodash.isEqual)(defaultValue,previousDefaultValue)||(selectedStartDateTimeAsDayjsRef.current=defaultValue?dayjs_min_default()(defaultValue[0]):void 0,selectedEndDateTimeAsDayjsRef.current=defaultValue?dayjs_min_default()(defaultValue[1]):void 0,selectedStartDateTupleRef.current=getUtcDateTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current),selectedEndDateTupleRef.current=getUtcDateTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current),selectedStartTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedStartDateTimeAsDayjsRef.current),selectedEndTimeTupleRef.current=getUtcTimeTupleFromDayjs(selectedEndDateTimeAsDayjsRef.current),forceUpdate()):hasMountedRef.current=!0}),[defaultValue,forceUpdate,previousDefaultValue]),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,legend:label,style,...nativeProps,children:[(0,jsx_runtime.jsxs)(DateRangePicker_Box,{$hasError:hasError,$isDisabled:disabled,children:[(0,jsx_runtime.jsx)(DateRangePicker_Field,{children:(0,jsx_runtime.jsx)(DateInput,{ref:startDateInputRef,baseContainer:baseContainer??void 0,disabled,isCompact,isForcedFocused:isRangeCalendarPickerOpen,isLight,isRange:!0,isStartDate:!0,onChange:(nextDateTuple,isFilled)=>handleDateInputChange(DateRangePosition.START,nextDateTuple,isFilled),onClick:openRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:handleStartDateInputNext,value:selectedStartDateTupleRef.current})}),withTime&&(0,jsx_runtime.jsx)(DateRangePicker_Field,{isTimeField:!0,children:(0,jsx_runtime.jsx)(TimeInput,{ref:startTimeInputRef,baseContainer:baseContainer??void 0,disabled,isCompact,isLight,isStartDate:!0,minutesRange,onBack:()=>startDateInputRef.current?.focus(!0),onChange:nextTimeTuple=>handleTimeInputChange(DateRangePosition.START,nextTimeTuple),onFocus:closeRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:()=>endDateInputRef.current?.focus(),onPrevious:()=>startDateInputRef.current?.focus(!0),value:selectedStartTimeTupleRef.current})}),(0,jsx_runtime.jsx)(DateRangePicker_Field,{isEndDateField:!0,children:(0,jsx_runtime.jsx)(DateInput,{ref:endDateInputRef,baseContainer:baseContainer??void 0,disabled,isCompact,isEndDate:!0,isForcedFocused:isRangeCalendarPickerOpen,isLight,isRange:!0,onBack:handleEndDateInputPrevious,onChange:(nextDateTuple,isFilled)=>handleDateInputChange(DateRangePosition.END,nextDateTuple,isFilled),onClick:openRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onNext:handleEndDateInputNext,onPrevious:handleEndDateInputPrevious,value:selectedEndDateTupleRef.current})}),withTime&&(0,jsx_runtime.jsx)(DateRangePicker_Field,{isTimeField:!0,children:(0,jsx_runtime.jsx)(TimeInput,{ref:endTimeInputRef,baseContainer:baseContainer??void 0,disabled,isCompact,isEndDate:!0,isLight,minutesRange,onBack:()=>endDateInputRef.current?.focus(!0),onChange:nextTimeTuple=>handleTimeInputChange(DateRangePosition.END,nextTimeTuple),onFocus:closeRangeCalendarPicker,onInput:callOnChangeUndefinedIfInputsAreEmpty,onPrevious:()=>endDateInputRef.current?.focus(!0),value:selectedEndTimeTupleRef.current})})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError}),(0,jsx_runtime.jsx)(RangeCalendarPicker,{defaultValue:rangeCalendarPickerDefaultValue,hasSingleCalendar,isHistorical,isOpen:isRangeCalendarPickerOpen,onChange:handleRangeCalendarPickerChange},JSON.stringify(rangeCalendarPickerDefaultValue))]})}DateRangePicker_DateRangePicker.displayName="DateRangePicker";const DateRangePicker_Box=styled_components_browser_esm.ZP.div` * { font-weight: 500; line-height: 1; @@ -1328,7 +1328,7 @@ `,DateRangePicker_Field=styled_components_browser_esm.ZP.span` font-size: inherit; margin-left: ${p=>p.isEndDateField?"10px":p.isTimeField?"2px":0}; -`;try{DateRangePicker_DateRangePicker.displayName="DateRangePicker",DateRangePicker_DateRangePicker.__docgenInfo={description:"",displayName:"DateRangePicker",props:{isStringDate:{defaultValue:{value:"false"},description:"",name:"isStringDate",required:!1,type:{name:"false"}},onChange:{defaultValue:null,description:"Called each time the date range picker is changed to a new valid value.",name:"onChange",required:!1,type:{name:"(nextUtcDateRange: DateRange) => Promisable"}},baseContainer:{defaultValue:null,description:"Used to pass something else than `window.document` as a base container to attach global events listeners.",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document | null"}},defaultValue:{defaultValue:null,description:"",name:"defaultValue",required:!1,type:{name:"DateRange | DateAsStringRange"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},hasSingleCalendar:{defaultValue:{value:"false"},description:"",name:"hasSingleCalendar",required:!1,type:{name:"boolean"}},isCompact:{defaultValue:{value:"false"},description:"",name:"isCompact",required:!1,type:{name:"boolean"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isHistorical:{defaultValue:{value:"false"},description:"Only allow past dates until today.",name:"isHistorical",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},minutesRange:{defaultValue:{value:"15"},description:"Range of minutes used to generate the time picker list.\n@example `15` would produce a list with `..., 10:45, 11:00, 11:15, ...`.",name:"minutesRange",required:!1,type:{name:"number"}},withTime:{defaultValue:{value:"false"},description:"",name:"withTime",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/DateRangePicker/index.tsx#DateRangePicker"]={docgenInfo:DateRangePicker_DateRangePicker.__docgenInfo,name:"DateRangePicker",path:"src/fields/DateRangePicker/index.tsx#DateRangePicker"})}catch(__react_docgen_typescript_loader_error){}var reject=__webpack_require__("./node_modules/ramda/es/reject.js"),equals=__webpack_require__("./node_modules/ramda/es/equals.js"),includes=__webpack_require__("./node_modules/ramda/es/includes.js");function MultiCheckbox({className,disabled=!1,error,isErrorMessageHidden=!1,isInline=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,name,onChange,options,style,value}){const controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-MultiCheckbox",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([value,disabled,name]),handleChange=(0,react.useCallback)(((nextOptionValue,isChecked)=>{if(!onChange)return;const nextCheckedOptionValues=isChecked?[...value||[],nextOptionValue]:(0,reject.Z)((0,equals.Z)(nextOptionValue))(value||[]),normalizedNextValue=nextCheckedOptionValues.length?nextCheckedOptionValues:void 0;onChange(normalizedNextValue)}),[onChange,value]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,isLight,legend:label,style,children:[(0,jsx_runtime.jsx)(ChecboxesBox,{$hasError:hasError,$isInline:isInline,children:options.map(((option,index)=>(0,jsx_runtime.jsx)(Checkbox_Checkbox,{checked:(0,includes.Z)(option.value,value||[]),disabled:option.isDisabled||disabled,label:option.label,name:`${name}${index}`,onChange:isChecked=>handleChange(option.value,isChecked)},JSON.stringify(option.value))))},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}MultiCheckbox.displayName="MultiCheckbox";const ChecboxesBox=styled_components_browser_esm.ZP.div` +`;try{DateRangePicker_DateRangePicker.displayName="DateRangePicker",DateRangePicker_DateRangePicker.__docgenInfo={description:"",displayName:"DateRangePicker",props:{isStringDate:{defaultValue:{value:"false"},description:"",name:"isStringDate",required:!1,type:{name:"false"}},onChange:{defaultValue:null,description:"Called each time the date range picker is changed to a new valid value.",name:"onChange",required:!1,type:{name:"(nextUtcDateRange: DateRange) => Promisable"}},baseContainer:{defaultValue:null,description:"Used to pass something else than `window.document` as a base container to attach global events listeners.",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document | null"}},defaultValue:{defaultValue:null,description:"",name:"defaultValue",required:!1,type:{name:"DateRange | DateAsStringRange"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},hasSingleCalendar:{defaultValue:{value:"false"},description:"",name:"hasSingleCalendar",required:!1,type:{name:"boolean"}},isCompact:{defaultValue:{value:"false"},description:"",name:"isCompact",required:!1,type:{name:"boolean"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isHistorical:{defaultValue:{value:"false"},description:"Only allow past dates until today.",name:"isHistorical",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},minutesRange:{defaultValue:{value:"15"},description:"Range of minutes used to generate the time picker list.\n@example `15` would produce a list with `..., 10:45, 11:00, 11:15, ...`.",name:"minutesRange",required:!1,type:{name:"number"}},withTime:{defaultValue:{value:"false"},description:"",name:"withTime",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/DateRangePicker/index.tsx#DateRangePicker"]={docgenInfo:DateRangePicker_DateRangePicker.__docgenInfo,name:"DateRangePicker",path:"src/fields/DateRangePicker/index.tsx#DateRangePicker"})}catch(__react_docgen_typescript_loader_error){}var reject=__webpack_require__("./node_modules/ramda/es/reject.js"),equals=__webpack_require__("./node_modules/ramda/es/equals.js"),includes=__webpack_require__("./node_modules/ramda/es/includes.js");function MultiCheckbox({className,disabled=!1,error,isErrorMessageHidden=!1,isInline=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,name,onChange,options,style,value}){const controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-MultiCheckbox",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([value,disabled,name]),handleChange=(0,react.useCallback)(((nextOptionValue,isChecked)=>{if(!onChange)return;const nextCheckedOptionValues=isChecked?[...value??[],nextOptionValue]:(0,reject.Z)((0,equals.Z)(nextOptionValue))(value??[]),normalizedNextValue=nextCheckedOptionValues.length?nextCheckedOptionValues:void 0;onChange(normalizedNextValue)}),[onChange,value]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,isLight,legend:label,style,children:[(0,jsx_runtime.jsx)(ChecboxesBox,{$hasError:hasError,$isInline:isInline,children:options.map(((option,index)=>(0,jsx_runtime.jsx)(Checkbox_Checkbox,{checked:(0,includes.Z)(option.value,value??[]),disabled:!!option.isDisabled||disabled,label:option.label,name:`${name}${index}`,onChange:isChecked=>handleChange(option.value,isChecked)},JSON.stringify(option.value))))},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}MultiCheckbox.displayName="MultiCheckbox";const ChecboxesBox=styled_components_browser_esm.ZP.div` color: ${p=>p.theme.color.gunMetal}; display: flex; flex-direction: ${p=>p.$isInline?"row":"column"}; @@ -1359,7 +1359,7 @@ } } `} -`;try{MultiCheckbox.displayName="MultiCheckbox",MultiCheckbox.__docgenInfo={description:"",displayName:"MultiCheckbox",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isInline:{defaultValue:{value:"false"},description:"",name:"isInline",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},name:{defaultValue:null,description:"",name:"name",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue[]) => Promisable)"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},style:{defaultValue:null,description:"",name:"style",required:!1,type:{name:"CSSProperties"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValue[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/MultiCheckbox.tsx#MultiCheckbox"]={docgenInfo:MultiCheckbox.__docgenInfo,name:"MultiCheckbox",path:"src/fields/MultiCheckbox.tsx#MultiCheckbox"})}catch(__react_docgen_typescript_loader_error){}var TagPicker=__webpack_require__("./node_modules/rsuite/esm/TagPicker/index.js");function MultiSelect({baseContainer,className,customSearch,customSearchMinQueryLength=1,disabled=!1,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,options,optionValueKey,searchable=!1,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-MultiSelect",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),rsuiteData=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([disabled,originalProps.name,value]),selectedRsuiteValue=(0,react.useMemo)((()=>(value||[]).map((valueItem=>getRsuiteValueFromOptionValue(valueItem,optionValueKey)))),[optionValueKey,value]),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?rsuiteData:void 0),[isOpen,setIsOpen]=(0,react.useState)(!1),{forceUpdate}=useForceUpdate(),close=(0,react.useCallback)((()=>{setIsOpen(!1)}),[]),getOptionValuesFromRsuiteDataValues=(0,react.useCallback)((rsuiteValues=>rsuiteData.reduce(((optionsValues,rsuiteDataItem)=>rsuiteValues.includes(rsuiteDataItem.value)?[...optionsValues,rsuiteDataItem.optionValue]:optionsValues),[])),[rsuiteData]),handleChange=(0,react.useCallback)((nextOptionRsuiteValues=>{if(!onChange)return;const nextValue=nextOptionRsuiteValues?getOptionValuesFromRsuiteDataValues(nextOptionRsuiteValues):[],normalizedNextValue=nextValue.length>0?nextValue:void 0;setControlledRsuiteData(rsuiteData),onChange(normalizedNextValue)}),[getOptionValuesFromRsuiteDataValues,onChange,rsuiteData]),handleSearch=(0,react.useCallback)((nextQuery=>{if(!customSearchRef.current||nextQuery.trim().length=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):rsuiteData;setControlledRsuiteData(nextControlledRsuiteData)}),[customSearchMinQueryLength,optionValueKey,rsuiteData]),renderMenuItem=(0,react.useCallback)((node=>(0,jsx_runtime.jsx)("span",{title:String(node),children:String(node)})),[]),toggle=(0,react.useCallback)((event=>{if(disabled)return;let targetElement=event.target;"path"===targetElement.tagName&&targetElement.parentElement&&(targetElement=targetElement.parentElement),(targetElement.classList.contains("rs-picker-toggle")||targetElement.classList.contains("rs-picker-tag-wrapper")||targetElement.classList.contains("rs-picker-toggle-caret"))&&setIsOpen(!isOpen)}),[isOpen,disabled]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),useClickOutsideEffect(boxRef,close,baseContainer),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassName,style,children:[(0,jsx_runtime.jsx)(Label,{disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(MultiSelect_Box,{ref:boxRef,$hasError:hasError,$isActive:isOpen,$isLight:isLight,onClick:toggle,children:boxRef.current&&(0,jsx_runtime.jsx)(TagPicker.Z,{container:boxRef.current,data:controlledRsuiteData||rsuiteData,disabled,id:originalProps.name,onChange:handleChange,onClick:toggle,onSearch:handleSearch,open:isOpen,renderMenuItem,searchable:!!customSearch||searchable,searchBy:customSearch?()=>!0:void 0,value:selectedRsuiteValue,...originalProps},key)}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}MultiSelect.displayName="MultiSelect";const MultiSelect_Box=styled_components_browser_esm.ZP.div` +`;try{MultiCheckbox.displayName="MultiCheckbox",MultiCheckbox.__docgenInfo={description:"",displayName:"MultiCheckbox",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isInline:{defaultValue:{value:"false"},description:"",name:"isInline",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},name:{defaultValue:null,description:"",name:"name",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue[]) => Promisable)"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},style:{defaultValue:null,description:"",name:"style",required:!1,type:{name:"CSSProperties"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValue[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/MultiCheckbox.tsx#MultiCheckbox"]={docgenInfo:MultiCheckbox.__docgenInfo,name:"MultiCheckbox",path:"src/fields/MultiCheckbox.tsx#MultiCheckbox"})}catch(__react_docgen_typescript_loader_error){}var TagPicker=__webpack_require__("./node_modules/rsuite/esm/TagPicker/index.js");function MultiSelect({baseContainer,className,customSearch,customSearchMinQueryLength=1,disabled=!1,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,options,optionValueKey,searchable=!1,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-MultiSelect",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),rsuiteData=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([disabled,originalProps.name,value]),selectedRsuiteValue=(0,react.useMemo)((()=>(value??[]).map((valueItem=>getRsuiteValueFromOptionValue(valueItem,optionValueKey)))),[optionValueKey,value]),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?rsuiteData:void 0),[isOpen,setIsOpen]=(0,react.useState)(!1),{forceUpdate}=useForceUpdate(),close=(0,react.useCallback)((()=>{setIsOpen(!1)}),[]),getOptionValuesFromRsuiteDataValues=(0,react.useCallback)((rsuiteValues=>rsuiteData.reduce(((optionsValues,rsuiteDataItem)=>rsuiteValues.includes(rsuiteDataItem.value)?[...optionsValues,rsuiteDataItem.optionValue]:optionsValues),[])),[rsuiteData]),handleChange=(0,react.useCallback)((nextOptionRsuiteValues=>{if(!onChange)return;const nextValue=nextOptionRsuiteValues?getOptionValuesFromRsuiteDataValues(nextOptionRsuiteValues):[],normalizedNextValue=nextValue.length>0?nextValue:void 0;setControlledRsuiteData(rsuiteData),onChange(normalizedNextValue)}),[getOptionValuesFromRsuiteDataValues,onChange,rsuiteData]),handleSearch=(0,react.useCallback)((nextQuery=>{if(!customSearchRef.current||nextQuery.trim().length=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):rsuiteData;setControlledRsuiteData(nextControlledRsuiteData)}),[customSearchMinQueryLength,optionValueKey,rsuiteData]),renderMenuItem=(0,react.useCallback)((node=>(0,jsx_runtime.jsx)("span",{title:String(node),children:String(node)})),[]),toggle=(0,react.useCallback)((event=>{if(disabled)return;let targetElement=event.target;"path"===targetElement.tagName&&targetElement.parentElement&&(targetElement=targetElement.parentElement),(targetElement.classList.contains("rs-picker-toggle")||targetElement.classList.contains("rs-picker-tag-wrapper")||targetElement.classList.contains("rs-picker-toggle-caret"))&&setIsOpen(!isOpen)}),[isOpen,disabled]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),useClickOutsideEffect(boxRef,close,baseContainer),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassName,style,children:[(0,jsx_runtime.jsx)(Label,{disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(MultiSelect_Box,{ref:boxRef,$hasError:hasError,$isActive:isOpen,$isLight:isLight,onClick:toggle,children:boxRef.current&&(0,jsx_runtime.jsx)(TagPicker.Z,{container:boxRef.current,data:controlledRsuiteData??rsuiteData,disabled,id:originalProps.name,onChange:handleChange,onClick:toggle,onSearch:handleSearch,open:isOpen,renderMenuItem,searchable:!!customSearch??searchable,searchBy:customSearch?()=>!0:void 0,value:selectedRsuiteValue,...originalProps},key)}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}MultiSelect.displayName="MultiSelect";const MultiSelect_Box=styled_components_browser_esm.ZP.div` position: relative; user-select: none; width: 100%; @@ -1471,7 +1471,7 @@ } } } -`;try{MultiSelect.displayName="MultiSelect",MultiSelect.__docgenInfo={description:"",displayName:"MultiSelect",props:{baseContainer:{defaultValue:null,description:"Used to pass something else than `window.document` as a base container to attach global events listeners.",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document | null"}},customSearch:{defaultValue:null,description:"",name:"customSearch",required:!1,type:{name:"CustomSearch>"}},customSearchMinQueryLength:{defaultValue:{value:"1"},description:"Minimum search query length required to trigger custom search filtering.",name:"customSearchMinQueryLength",required:!1,type:{name:"number"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue[]) => Promisable)"}},optionValueKey:{defaultValue:null,description:"",name:"optionValueKey",required:!1,type:{name:"string | number | symbol"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValue[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/MultiSelect.tsx#MultiSelect"]={docgenInfo:MultiSelect.__docgenInfo,name:"MultiSelect",path:"src/fields/MultiSelect.tsx#MultiSelect"})}catch(__react_docgen_typescript_loader_error){}var Radio=__webpack_require__("./node_modules/rsuite/esm/Radio/index.js");function MultiRadio({className,disabled=!1,error,isErrorMessageHidden=!1,isInline=!1,isLabelHidden=!1,isLight=!1,isReadOnly=!1,isUndefinedWhenDisabled=!1,label,name,onChange,options,style,value}){const controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-MultiRadio",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([value,disabled,name]),handleChange=(0,react.useCallback)(((nextOptionValue,isChecked)=>{if(!onChange)return;onChange(isChecked?nextOptionValue:void 0)}),[onChange]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled&&!isReadOnly,onChange),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,isLight,legend:label,style,children:[(0,jsx_runtime.jsx)(MultiRadio_Box,{$hasError:hasError,$isInline:isInline,$isReadOnly:isReadOnly,children:options.map((option=>(0,jsx_runtime.jsx)(Radio.Z,{checked:(0,equals.Z)(option.value,value),disabled:option.isDisabled||disabled,name,onChange:(_,isChecked)=>handleChange(option.value,isChecked),readOnly:isReadOnly,children:option.label},JSON.stringify(option.value))))},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}MultiRadio.displayName="MultiRadio";const MultiRadio_Box=styled_components_browser_esm.ZP.div` +`;try{MultiSelect.displayName="MultiSelect",MultiSelect.__docgenInfo={description:"",displayName:"MultiSelect",props:{baseContainer:{defaultValue:null,description:"Used to pass something else than `window.document` as a base container to attach global events listeners.",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document | null"}},customSearch:{defaultValue:null,description:"",name:"customSearch",required:!1,type:{name:"CustomSearch>"}},customSearchMinQueryLength:{defaultValue:{value:"1"},description:"Minimum search query length required to trigger custom search filtering.",name:"customSearchMinQueryLength",required:!1,type:{name:"number"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue[]) => Promisable)"}},optionValueKey:{defaultValue:null,description:"",name:"optionValueKey",required:!1,type:{name:"string | number | symbol"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValue[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/MultiSelect.tsx#MultiSelect"]={docgenInfo:MultiSelect.__docgenInfo,name:"MultiSelect",path:"src/fields/MultiSelect.tsx#MultiSelect"})}catch(__react_docgen_typescript_loader_error){}var Radio=__webpack_require__("./node_modules/rsuite/esm/Radio/index.js");function MultiRadio({className,disabled=!1,error,isErrorMessageHidden=!1,isInline=!1,isLabelHidden=!1,isLight=!1,isReadOnly=!1,isUndefinedWhenDisabled=!1,label,name,onChange,options,style,value}){const controlledClassName=(0,react.useMemo)((()=>classnames_default()("Field-MultiRadio",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([value,disabled,name]),handleChange=(0,react.useCallback)(((nextOptionValue,isChecked)=>{if(!onChange)return;onChange(isChecked?nextOptionValue:void 0)}),[onChange]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled&&!isReadOnly,onChange),(0,jsx_runtime.jsxs)(Fieldset,{className:controlledClassName,disabled,hasError,isLegendHidden:isLabelHidden,isLight,legend:label,style,children:[(0,jsx_runtime.jsx)(MultiRadio_Box,{$hasError:hasError,$isInline:isInline,$isReadOnly:isReadOnly,children:options.map((option=>(0,jsx_runtime.jsx)(Radio.Z,{checked:(0,equals.Z)(option.value,value),disabled:!!option.isDisabled||disabled,name,onChange:(_,isChecked)=>handleChange(option.value,isChecked),readOnly:isReadOnly,children:option.label},JSON.stringify(option.value))))},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}MultiRadio.displayName="MultiRadio";const MultiRadio_Box=styled_components_browser_esm.ZP.div` color: ${p=>p.theme.color.gunMetal}; display: flex; flex-direction: ${p=>p.$isInline?"row":"column"}; @@ -1557,7 +1557,7 @@ line-height: 1; margin: -2px 0 0 8px; } -`;try{MultiZoneEditor.displayName="MultiZoneEditor",MultiZoneEditor.__docgenInfo={description:"",displayName:"MultiZoneEditor",props:{addButtonLabel:{defaultValue:null,description:"",name:"addButtonLabel",required:!0,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},defaultValue:{defaultValue:{value:"[]"},description:"",name:"defaultValue",required:!1,type:{name:"Record[]"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},initialZone:{defaultValue:null,description:"",name:"initialZone",required:!0,type:{name:"Record"}},isAddButtonDisabled:{defaultValue:{value:"false"},description:"",name:"isAddButtonDisabled",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},labelPropName:{defaultValue:null,description:"",name:"labelPropName",required:!0,type:{name:"string"}},onAdd:{defaultValue:null,description:"",name:"onAdd",required:!1,type:{name:"((nextZones: Record[], index: number) => Promisable)"}},onCenter:{defaultValue:null,description:"",name:"onCenter",required:!1,type:{name:"((zone: Record) => Promisable)"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextZones: Record[]) => Promisable)"}},onDelete:{defaultValue:null,description:"",name:"onDelete",required:!1,type:{name:"((nextZones: Record[]) => Promisable)"}},onEdit:{defaultValue:null,description:"",name:"onEdit",required:!1,type:{name:"((zone: Record, index: number) => Promisable)"}},style:{defaultValue:null,description:"",name:"style",required:!1,type:{name:"CSSProperties"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/MultiZoneEditor/index.tsx#MultiZoneEditor"]={docgenInfo:MultiZoneEditor.__docgenInfo,name:"MultiZoneEditor",path:"src/fields/MultiZoneEditor/index.tsx#MultiZoneEditor"})}catch(__react_docgen_typescript_loader_error){}var Input=__webpack_require__("./node_modules/rsuite/esm/Input/index.js");function NumberInput_NumberInput({className,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onBlur,onChange,onFocus,style,value,...originalProps}){const inputRef=(0,react.useRef)(null),controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-NumberInput",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([originalProps.disabled,originalProps.name]),preventWheelEvent=usePreventWheelEvent(inputRef),handleChange=(0,react.useCallback)((nextValue=>{if(!onChange)return;const normalizedNextValueAsString=nextValue&&nextValue.length?nextValue:void 0,nextValueAsNumber=Number(normalizedNextValueAsString),normalizedNextValue=Number.isNaN(nextValueAsNumber)?void 0:nextValueAsNumber;onChange(normalizedNextValue)}),[onChange]),handleBlur=(0,react.useCallback)((event=>{event.target.removeEventListener("wheel",preventWheelEvent),onBlur&&onBlur(event)}),[onBlur,preventWheelEvent]),handleFocus=(0,react.useCallback)((event=>{event.target.addEventListener("wheel",preventWheelEvent),onFocus&&onFocus(event)}),[onFocus,preventWheelEvent]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&originalProps.disabled,onChange),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(StyledInput,{ref:inputRef,$hasError:hasError,$isLight:isLight,id:originalProps.name,onBlur:handleBlur,onChange:handleChange,onFocus:handleFocus,type:"number",value:value||"",...originalProps},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}NumberInput_NumberInput.displayName="NumberInput";const StyledInput=(0,styled_components_browser_esm.ZP)(Input.Z)` +`;try{MultiZoneEditor.displayName="MultiZoneEditor",MultiZoneEditor.__docgenInfo={description:"",displayName:"MultiZoneEditor",props:{addButtonLabel:{defaultValue:null,description:"",name:"addButtonLabel",required:!0,type:{name:"string"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},defaultValue:{defaultValue:{value:"[]"},description:"",name:"defaultValue",required:!1,type:{name:"Record[]"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},initialZone:{defaultValue:null,description:"",name:"initialZone",required:!0,type:{name:"Record"}},isAddButtonDisabled:{defaultValue:{value:"false"},description:"",name:"isAddButtonDisabled",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},labelPropName:{defaultValue:null,description:"",name:"labelPropName",required:!0,type:{name:"string"}},onAdd:{defaultValue:null,description:"",name:"onAdd",required:!1,type:{name:"((nextZones: Record[], index: number) => Promisable)"}},onCenter:{defaultValue:null,description:"",name:"onCenter",required:!1,type:{name:"((zone: Record) => Promisable)"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextZones: Record[]) => Promisable)"}},onDelete:{defaultValue:null,description:"",name:"onDelete",required:!1,type:{name:"((nextZones: Record[]) => Promisable)"}},onEdit:{defaultValue:null,description:"",name:"onEdit",required:!1,type:{name:"((zone: Record, index: number) => Promisable)"}},style:{defaultValue:null,description:"",name:"style",required:!1,type:{name:"CSSProperties"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/MultiZoneEditor/index.tsx#MultiZoneEditor"]={docgenInfo:MultiZoneEditor.__docgenInfo,name:"MultiZoneEditor",path:"src/fields/MultiZoneEditor/index.tsx#MultiZoneEditor"})}catch(__react_docgen_typescript_loader_error){}var Input=__webpack_require__("./node_modules/rsuite/esm/Input/index.js");function NumberInput_NumberInput({className,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onBlur,onChange,onFocus,style,value,...originalProps}){const inputRef=(0,react.useRef)(null),controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-NumberInput",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([originalProps.disabled,originalProps.name]),preventWheelEvent=usePreventWheelEvent(inputRef),handleChange=(0,react.useCallback)((nextValue=>{if(!onChange)return;const normalizedNextValueAsString=nextValue&&nextValue.length?nextValue:void 0,nextValueAsNumber=Number(normalizedNextValueAsString),normalizedNextValue=Number.isNaN(nextValueAsNumber)?void 0:nextValueAsNumber;onChange(normalizedNextValue)}),[onChange]),handleBlur=(0,react.useCallback)((event=>{event.target.removeEventListener("wheel",preventWheelEvent),onBlur&&onBlur(event)}),[onBlur,preventWheelEvent]),handleFocus=(0,react.useCallback)((event=>{event.target.addEventListener("wheel",preventWheelEvent),onFocus&&onFocus(event)}),[onFocus,preventWheelEvent]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&originalProps.disabled,onChange),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(StyledInput,{ref:inputRef,$hasError:hasError,$isLight:isLight,id:originalProps.name,onBlur:handleBlur,onChange:handleChange,onFocus:handleFocus,type:"number",value:value??"",...originalProps},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}NumberInput_NumberInput.displayName="NumberInput";const StyledInput=(0,styled_components_browser_esm.ZP)(Input.Z)` background-color: ${p=>p.$isLight?p.theme.color.white:p.theme.color.gainsboro}; border: solid 1px ${p=>p.$hasError?p.theme.color.maximumRed:p.theme.color.gainsboro}; border-radius: 0; @@ -1589,7 +1589,7 @@ `,DDCoordinatesInput_Box=styled_components_browser_esm.ZP.div` font-size: 13px; text-align: left; -`;try{DDCoordinatesInput.displayName="DDCoordinatesInput",DDCoordinatesInput.__docgenInfo={description:"",displayName:"DDCoordinatesInput",props:{coordinates:{defaultValue:null,description:"",name:"coordinates",required:!0,type:{name:"Coordinates | undefined"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/CoordinatesInput/DDCoordinatesInput.tsx#DDCoordinatesInput"]={docgenInfo:DDCoordinatesInput.__docgenInfo,name:"DDCoordinatesInput",path:"src/fields/CoordinatesInput/DDCoordinatesInput.tsx#DDCoordinatesInput"})}catch(__react_docgen_typescript_loader_error){}var index_es=__webpack_require__("./node_modules/react-coordinate-input/dist/index.es.js"),esm=__webpack_require__("./node_modules/react-imask/esm/index.js"),proj=__webpack_require__("./node_modules/ol/proj.js"),CoordinateLatLon=function(CoordinateLatLon){return CoordinateLatLon.LATITUDE="LATITUDE",CoordinateLatLon.LONGITUDE="LONGITUDE",CoordinateLatLon}(CoordinateLatLon||{});const getCoordinates=(coordinates,projection,coordinatesFormat,isForPrint=!0)=>{if(!coordinates)return["",""];const transformedCoordinates=(0,proj.vs)(coordinates,projection,constants.Oq);switch(coordinatesFormat){case constants.PA.DEGREES_MINUTES_SECONDS:return function getDMSCoordinates(transformedCoordinates){const[longitude,latitude]=transformedCoordinates;if(!isNumeric_isNumeric(latitude)||!isNumeric_isNumeric(longitude))return[];const latitudeDMS=getDMSFromDecimal(latitude,CoordinateLatLon.LATITUDE),longitudeDMS=getDMSFromDecimal(longitude,CoordinateLatLon.LONGITUDE);return[latitudeDMS,longitudeDMS]}(transformedCoordinates);case constants.PA.DEGREES_MINUTES_DECIMALS:return function getDMDCoordinates(transformedCoordinates){const[longitude,latitude]=transformedCoordinates;if(!isNumeric_isNumeric(latitude)||!isNumeric_isNumeric(longitude))return[];const latitudeDMD=getDMDFromDecimal(latitude,CoordinateLatLon.LATITUDE),longitudeDMD=getDMDFromDecimal(longitude,CoordinateLatLon.LONGITUDE);return[latitudeDMD,longitudeDMD]}(transformedCoordinates);case constants.PA.DECIMAL_DEGREES:return function getDDCoordinates(transformedCoordinates,isForPrint){if(!Array.isArray(transformedCoordinates)||2!==transformedCoordinates.length||!transformedCoordinates[0]||!transformedCoordinates[1])return[];const isNegative=-1===Math.sign(transformedCoordinates[0]),[longitudeInteger,longitudeDecimals]=transformedCoordinates[0].toString().split("."),precision=isForPrint?4:6;if(!isNumeric_isNumeric(longitudeInteger))return[];let longitude=longitudeInteger.toString().trim().replace(/-/g,"");const decimals=longitudeDecimals?.substring(0,precision)||"000000";return longitude=`${isNegative?"-":""}${getPaddedDegrees(longitude,CoordinateLatLon.LONGITUDE)}.${decimals}`,[`${transformedCoordinates[1].toFixed(precision)}°`,`${longitude}°`]}(transformedCoordinates,isForPrint);default:return["",""]}};function getDMDFromDecimal(dd,latitudeOrLongitude){const hemisphere=getHemisphere(dd,latitudeOrLongitude),absoluteDecimalDegrees=Math.abs(dd),degrees=truncate(absoluteDecimalDegrees),[minutesInteger,minuteDecimals]=getMinutes(absoluteDecimalDegrees,degrees);return`${getPaddedDegrees(degrees,latitudeOrLongitude)}° ${minutesInteger.padStart(2,"0")}.${minuteDecimals.padStart(3,"0").substring(0,3)}′ ${hemisphere}`}function getDMSFromDecimal(dd,latitudeOrLongitude){const hemisphere=getHemisphere(dd,latitudeOrLongitude),absoluteDecimalDegrees=Math.abs(dd),degrees=truncate(absoluteDecimalDegrees),[minutesInteger,minutesDecimal]=getMinutes(absoluteDecimalDegrees,degrees),seconds=(.001*Number(minutesDecimal)*60).toFixed(0);return`${getPaddedDegrees(degrees,latitudeOrLongitude)}° ${minutesInteger.padStart(2,"0")}′ ${seconds.toString().padStart(2,"0")}″${hemisphere?` ${hemisphere}`:""}`}const getMinutes=(absoluteDecimalDegrees,degrees)=>{let minutes=Number(60*(absoluteDecimalDegrees-degrees)).toFixed(3);minutes.split(".").length<1&&(minutes+=".000");const[minutesInteger,minuteDecimals]=minutes.split(".");if(!minutesInteger||!minuteDecimals)throw new Error("`minutesInteger` or `minuteDecimals` are undefined.");return[minutesInteger,minuteDecimals]},getHemisphere=(dd,latitudeOrLongitude)=>{if(0===dd)return"";switch(latitudeOrLongitude){case CoordinateLatLon.LATITUDE:return dd<0?"S":"N";case CoordinateLatLon.LONGITUDE:return dd<0?"W":"E";default:return""}},getPaddedDegrees=(degrees,latitudeOrLongitude)=>{switch(latitudeOrLongitude){case CoordinateLatLon.LATITUDE:return degrees.toString().padStart(2,"0");case CoordinateLatLon.LONGITUDE:return degrees.toString().padStart(3,"0");default:return""}};function truncate(n){return n>0?Math.floor(n):Math.ceil(n)}const UntypedIMaskInput=esm.oc;function DMDCoordinatesInput({coordinates,coordinatesFormat,disabled=!1,isLight,onChange}){const[error,setError]=(0,react.useState)(""),[value,setValue]=(0,react.useState)("");return(0,react.useEffect)((()=>{if(coordinates?.length&&coordinatesFormat){const nextValue=getCoordinates([coordinates[1],coordinates[0]],constants.Oq,constants.PA.DEGREES_MINUTES_DECIMALS).map((coordinate=>coordinate.replace(/[°′. ]/g,""))).join("");setValue(nextValue)}else setValue("")}),[coordinates,coordinatesFormat]),(0,jsx_runtime.jsxs)(DMDCoordinatesInput_Box,{children:[(0,jsx_runtime.jsx)(UntypedIMaskInput,{"data-cy":"dmd-coordinates-input",disabled,lazy:!1,mask:"00° 00.00′ a 000° 00.00′ a",onAccept:(_,mask)=>setValue(mask.value),onComplete:(_,mask)=>function completeCoordinates(mask){setError("");const latitude=mask._unmaskedValue.substring(0,7),longitude=mask._unmaskedValue.substring(7,mask._unmaskedValue.length),NS=latitude[latitude.length-1].toUpperCase();if(!["N","S"].includes(NS))return void setError("La latitude doit être N ou S");const latitudeDegrees=parseInt(latitude.substring(0,2),10);if(latitudeDegrees<0||latitudeDegrees>90)return void setError("La latitude doit être comprise entre 0 et 90°");const latitudeMinutes=parseInt(latitude.substring(2,4),10),latitudeSeconds=parseInt(latitude.substring(4,6),10),EW=longitude[longitude.length-1].toUpperCase();if(!["E","W"].includes(EW))return void setError("La longitude doit être E ou W");const longitudeDegrees=parseInt(longitude.substring(0,3),10);if(longitudeDegrees<0||longitudeDegrees>180)return void setError("La longitude doit être comprise entre 0 et 180°");const longitudeMinutes=parseInt(longitude.substring(3,5),10),longitudeSeconds=parseInt(longitude.substring(5,7),10),dLatitude=(0,index_es.Uu)(latitudeDegrees,latitudeMinutes+.01*latitudeSeconds,0,NS,6),dLongitude=(0,index_es.Uu)(longitudeDegrees,longitudeMinutes+.01*longitudeSeconds,0,EW,6);isNumeric_isNumeric(dLatitude)&&isNumeric_isNumeric(dLongitude)?onChange([dLatitude,dLongitude],coordinates):setError("Format lat/long invalide")}(mask),placeholder:"__° __.___′ _ ___° __.___′",radix:".",style:{backgroundColor:isLight?THEME.color.white:THEME.color.gainsboro,border:error?"1px solid red":void 0},value}),(0,jsx_runtime.jsx)(DMDCoordinatesInput_CoordinatesType,{children:"(DMD)"}),(0,jsx_runtime.jsx)(DMDCoordinatesInput_Error,{children:error})]})}DMDCoordinatesInput.displayName="DMDCoordinatesInput";const DMDCoordinatesInput_CoordinatesType=styled_components_browser_esm.ZP.span` +`;try{DDCoordinatesInput.displayName="DDCoordinatesInput",DDCoordinatesInput.__docgenInfo={description:"",displayName:"DDCoordinatesInput",props:{coordinates:{defaultValue:null,description:"",name:"coordinates",required:!0,type:{name:"Coordinates | undefined"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/CoordinatesInput/DDCoordinatesInput.tsx#DDCoordinatesInput"]={docgenInfo:DDCoordinatesInput.__docgenInfo,name:"DDCoordinatesInput",path:"src/fields/CoordinatesInput/DDCoordinatesInput.tsx#DDCoordinatesInput"})}catch(__react_docgen_typescript_loader_error){}var index_es=__webpack_require__("./node_modules/react-coordinate-input/dist/index.es.js"),esm=__webpack_require__("./node_modules/react-imask/esm/index.js"),proj=__webpack_require__("./node_modules/ol/proj.js"),CoordinateLatLon=function(CoordinateLatLon){return CoordinateLatLon.LATITUDE="LATITUDE",CoordinateLatLon.LONGITUDE="LONGITUDE",CoordinateLatLon}(CoordinateLatLon||{});const getCoordinates=(coordinates,projection,coordinatesFormat,isForPrint=!0)=>{if(!coordinates)return["",""];const transformedCoordinates=(0,proj.vs)(coordinates,projection,constants.Oq);switch(coordinatesFormat){case constants.PA.DEGREES_MINUTES_SECONDS:return function getDMSCoordinates(transformedCoordinates){const[longitude,latitude]=transformedCoordinates;if(!isNumeric_isNumeric(latitude)||!isNumeric_isNumeric(longitude))return[];const latitudeDMS=getDMSFromDecimal(latitude,CoordinateLatLon.LATITUDE),longitudeDMS=getDMSFromDecimal(longitude,CoordinateLatLon.LONGITUDE);return[latitudeDMS,longitudeDMS]}(transformedCoordinates);case constants.PA.DEGREES_MINUTES_DECIMALS:return function getDMDCoordinates(transformedCoordinates){const[longitude,latitude]=transformedCoordinates;if(!isNumeric_isNumeric(latitude)||!isNumeric_isNumeric(longitude))return[];const latitudeDMD=getDMDFromDecimal(latitude,CoordinateLatLon.LATITUDE),longitudeDMD=getDMDFromDecimal(longitude,CoordinateLatLon.LONGITUDE);return[latitudeDMD,longitudeDMD]}(transformedCoordinates);case constants.PA.DECIMAL_DEGREES:return function getDDCoordinates(transformedCoordinates,isForPrint){if(!Array.isArray(transformedCoordinates)||2!==transformedCoordinates.length||!transformedCoordinates[0]||!transformedCoordinates[1])return[];const isNegative=-1===Math.sign(transformedCoordinates[0]),[longitudeInteger,longitudeDecimals]=transformedCoordinates[0].toString().split("."),precision=isForPrint?4:6;if(!isNumeric_isNumeric(longitudeInteger))return[];let longitude=longitudeInteger.toString().trim().replace(/-/g,"");const decimals=longitudeDecimals?.substring(0,precision)??"000000";return longitude=`${isNegative?"-":""}${getPaddedDegrees(longitude,CoordinateLatLon.LONGITUDE)}.${decimals}`,[`${transformedCoordinates[1].toFixed(precision)}°`,`${longitude}°`]}(transformedCoordinates,isForPrint);default:return["",""]}};function getDMDFromDecimal(dd,latitudeOrLongitude){const hemisphere=getHemisphere(dd,latitudeOrLongitude),absoluteDecimalDegrees=Math.abs(dd),degrees=truncate(absoluteDecimalDegrees),[minutesInteger,minuteDecimals]=getMinutes(absoluteDecimalDegrees,degrees);return`${getPaddedDegrees(degrees,latitudeOrLongitude)}° ${minutesInteger.padStart(2,"0")}.${minuteDecimals.padStart(3,"0").substring(0,3)}′ ${hemisphere}`}function getDMSFromDecimal(dd,latitudeOrLongitude){const hemisphere=getHemisphere(dd,latitudeOrLongitude),absoluteDecimalDegrees=Math.abs(dd),degrees=truncate(absoluteDecimalDegrees),[minutesInteger,minutesDecimal]=getMinutes(absoluteDecimalDegrees,degrees),seconds=(.001*Number(minutesDecimal)*60).toFixed(0);return`${getPaddedDegrees(degrees,latitudeOrLongitude)}° ${minutesInteger.padStart(2,"0")}′ ${seconds.toString().padStart(2,"0")}″${hemisphere?` ${hemisphere}`:""}`}const getMinutes=(absoluteDecimalDegrees,degrees)=>{let minutes=Number(60*(absoluteDecimalDegrees-degrees)).toFixed(3);minutes.split(".").length<1&&(minutes+=".000");const[minutesInteger,minuteDecimals]=minutes.split(".");if(!minutesInteger||!minuteDecimals)throw new Error("`minutesInteger` or `minuteDecimals` are undefined.");return[minutesInteger,minuteDecimals]},getHemisphere=(dd,latitudeOrLongitude)=>{if(0===dd)return"";switch(latitudeOrLongitude){case CoordinateLatLon.LATITUDE:return dd<0?"S":"N";case CoordinateLatLon.LONGITUDE:return dd<0?"W":"E";default:return""}},getPaddedDegrees=(degrees,latitudeOrLongitude)=>{switch(latitudeOrLongitude){case CoordinateLatLon.LATITUDE:return degrees.toString().padStart(2,"0");case CoordinateLatLon.LONGITUDE:return degrees.toString().padStart(3,"0");default:return""}};function truncate(n){return n>0?Math.floor(n):Math.ceil(n)}const UntypedIMaskInput=esm.oc;function DMDCoordinatesInput({coordinates,coordinatesFormat,disabled=!1,isLight,onChange}){const[error,setError]=(0,react.useState)(""),[value,setValue]=(0,react.useState)("");return(0,react.useEffect)((()=>{if(coordinates?.length&&coordinatesFormat){const nextValue=getCoordinates([coordinates[1],coordinates[0]],constants.Oq,constants.PA.DEGREES_MINUTES_DECIMALS).map((coordinate=>coordinate.replace(/[°′. ]/g,""))).join("");setValue(nextValue)}else setValue("")}),[coordinates,coordinatesFormat]),(0,jsx_runtime.jsxs)(DMDCoordinatesInput_Box,{children:[(0,jsx_runtime.jsx)(UntypedIMaskInput,{"data-cy":"dmd-coordinates-input",disabled,lazy:!1,mask:"00° 00.00′ a 000° 00.00′ a",onAccept:(_,mask)=>setValue(mask.value),onComplete:(_,mask)=>function completeCoordinates(mask){setError("");const latitude=mask._unmaskedValue.substring(0,7),longitude=mask._unmaskedValue.substring(7,mask._unmaskedValue.length),NS=latitude[latitude.length-1].toUpperCase();if(!["N","S"].includes(NS))return void setError("La latitude doit être N ou S");const latitudeDegrees=parseInt(latitude.substring(0,2),10);if(latitudeDegrees<0||latitudeDegrees>90)return void setError("La latitude doit être comprise entre 0 et 90°");const latitudeMinutes=parseInt(latitude.substring(2,4),10),latitudeSeconds=parseInt(latitude.substring(4,6),10),EW=longitude[longitude.length-1].toUpperCase();if(!["E","W"].includes(EW))return void setError("La longitude doit être E ou W");const longitudeDegrees=parseInt(longitude.substring(0,3),10);if(longitudeDegrees<0||longitudeDegrees>180)return void setError("La longitude doit être comprise entre 0 et 180°");const longitudeMinutes=parseInt(longitude.substring(3,5),10),longitudeSeconds=parseInt(longitude.substring(5,7),10),dLatitude=(0,index_es.Uu)(latitudeDegrees,latitudeMinutes+.01*latitudeSeconds,0,NS,6),dLongitude=(0,index_es.Uu)(longitudeDegrees,longitudeMinutes+.01*longitudeSeconds,0,EW,6);isNumeric_isNumeric(dLatitude)&&isNumeric_isNumeric(dLongitude)?onChange([dLatitude,dLongitude],coordinates):setError("Format lat/long invalide")}(mask),placeholder:"__° __.___′ _ ___° __.___′",radix:".",style:{backgroundColor:isLight?THEME.color.white:THEME.color.gainsboro,border:error?"1px solid red":void 0},value}),(0,jsx_runtime.jsx)(DMDCoordinatesInput_CoordinatesType,{children:"(DMD)"}),(0,jsx_runtime.jsx)(DMDCoordinatesInput_Error,{children:error})]})}DMDCoordinatesInput.displayName="DMDCoordinatesInput";const DMDCoordinatesInput_CoordinatesType=styled_components_browser_esm.ZP.span` margin-left: 7px; color: ${p=>p.theme.color.slateGray}; `,DMDCoordinatesInput_Error=styled_components_browser_esm.ZP.span` @@ -1612,7 +1612,7 @@ height: 33px; padding: 7px 11px; } -`;try{CoordinatesInput.displayName="CoordinatesInput",CoordinatesInput.__docgenInfo={description:"",displayName:"CoordinatesInput",props:{hasBorder:{defaultValue:null,description:"",name:"hasBorder",required:!1,type:{name:"boolean"}},hasError:{defaultValue:null,description:"",name:"hasError",required:!1,type:{name:"boolean"}},isLegendHidden:{defaultValue:null,description:"",name:"isLegendHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},legend:{defaultValue:null,description:"",name:"legend",required:!1,type:{name:"string"}},coordinatesFormat:{defaultValue:null,description:"",name:"coordinatesFormat",required:!0,type:{name:"enum",value:[{value:'"DD"'},{value:'"DMD"'},{value:'"DMS"'}]}},defaultValue:{defaultValue:null,description:"",name:"defaultValue",required:!1,type:{name:"Coordinates"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextCoordinates: Coordinates, coordinates: Coordinates) => Promisable) | undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/CoordinatesInput/index.tsx#CoordinatesInput"]={docgenInfo:CoordinatesInput.__docgenInfo,name:"CoordinatesInput",path:"src/fields/CoordinatesInput/index.tsx#CoordinatesInput"})}catch(__react_docgen_typescript_loader_error){}var SelectPicker=__webpack_require__("./node_modules/rsuite/esm/SelectPicker/index.js");function Select({baseContainer,className,customSearch,customSearchMinQueryLength=1,disabled=!1,error,isCleanable=!0,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,options,optionValueKey,searchable=!1,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),{forceUpdate}=useForceUpdate(),controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-Select",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),rsuiteData=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([disabled,originalProps.name,value]),selectedRsuiteValue=(0,react.useMemo)((()=>getRsuiteValueFromOptionValue(value,optionValueKey)),[value,optionValueKey]),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?rsuiteData:void 0),[isOpen,setIsOpen]=(0,react.useState)(!1),close=(0,react.useCallback)((()=>{setIsOpen(!1)}),[]),handleClean=(0,react.useCallback)((()=>{onChange&&onChange(void 0)}),[onChange]),handleSearch=(0,react.useCallback)((nextQuery=>{if(!customSearchRef.current||nextQuery.trim().length=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):rsuiteData;setControlledRsuiteData(nextControlledRsuiteData)}),[customSearchMinQueryLength,optionValueKey,rsuiteData]),handleSelect=(0,react.useCallback)(((_,selectedItem)=>{close(),onChange&&onChange(selectedItem.optionValue)}),[close,onChange]),renderMenuItem=(0,react.useCallback)((node=>(0,jsx_runtime.jsx)("span",{title:String(node),children:String(node)})),[]),toggle=(0,react.useCallback)((event=>{if(disabled)return;let targetElement=event.target;"path"===targetElement.tagName&&targetElement.parentElement&&(targetElement=targetElement.parentElement),(targetElement.classList.contains("rs-picker-toggle")||targetElement.classList.contains("rs-picker-toggle-value")||targetElement.classList.contains("rs-stack-item")||targetElement.classList.contains("rs-picker-toggle-caret")||targetElement.classList.contains("rs-picker-toggle-placeholder"))&&setIsOpen(!isOpen)}),[isOpen,disabled]),disabledItemValues=(0,react.useMemo)((()=>(controlledRsuiteData||rsuiteData).filter((option=>option.isDisabled)).map((option=>option.value))),[controlledRsuiteData,rsuiteData]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),useClickOutsideEffect(boxRef,close,baseContainer),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(Select_Box,{ref:boxRef,$hasError:hasError,onClick:toggle,children:boxRef.current&&(0,jsx_runtime.jsx)(StyledSelectPicker,{$isLight:isLight,cleanable:isCleanable,container:boxRef.current,data:controlledRsuiteData||rsuiteData,disabled,disabledItemValues,id:originalProps.name,onClean:handleClean,onSearch:handleSearch,onSelect:handleSelect,open:isOpen,renderMenuItem,searchable:!!customSearch||searchable,searchBy:customSearch?()=>!0:void 0,value:selectedRsuiteValue,...originalProps},key)}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}Select.displayName="Select";const StyledSelectPicker=(0,styled_components_browser_esm.ZP)(SelectPicker.Z)` +`;try{CoordinatesInput.displayName="CoordinatesInput",CoordinatesInput.__docgenInfo={description:"",displayName:"CoordinatesInput",props:{hasBorder:{defaultValue:null,description:"",name:"hasBorder",required:!1,type:{name:"boolean"}},hasError:{defaultValue:null,description:"",name:"hasError",required:!1,type:{name:"boolean"}},isLegendHidden:{defaultValue:null,description:"",name:"isLegendHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},legend:{defaultValue:null,description:"",name:"legend",required:!1,type:{name:"string"}},coordinatesFormat:{defaultValue:null,description:"",name:"coordinatesFormat",required:!0,type:{name:"enum",value:[{value:'"DD"'},{value:'"DMD"'},{value:'"DMS"'}]}},defaultValue:{defaultValue:null,description:"",name:"defaultValue",required:!1,type:{name:"Coordinates"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextCoordinates: Coordinates, coordinates: Coordinates) => Promisable) | undefined"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/CoordinatesInput/index.tsx#CoordinatesInput"]={docgenInfo:CoordinatesInput.__docgenInfo,name:"CoordinatesInput",path:"src/fields/CoordinatesInput/index.tsx#CoordinatesInput"})}catch(__react_docgen_typescript_loader_error){}var SelectPicker=__webpack_require__("./node_modules/rsuite/esm/SelectPicker/index.js");function Select({baseContainer,className,customSearch,customSearchMinQueryLength=1,disabled=!1,error,isCleanable=!0,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,options,optionValueKey,searchable=!1,style,value,...originalProps}){const boxRef=(0,react.useRef)(null),customSearchRef=(0,react.useRef)(customSearch),{forceUpdate}=useForceUpdate(),controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-Select",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),rsuiteData=(0,react.useMemo)((()=>getRsuiteDataFromOptions(options,optionValueKey)),[options,optionValueKey]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([disabled,originalProps.name,value]),selectedRsuiteValue=(0,react.useMemo)((()=>getRsuiteValueFromOptionValue(value,optionValueKey)),[value,optionValueKey]),[controlledRsuiteData,setControlledRsuiteData]=(0,react.useState)(customSearch?rsuiteData:void 0),[isOpen,setIsOpen]=(0,react.useState)(!1),close=(0,react.useCallback)((()=>{setIsOpen(!1)}),[]),handleClean=(0,react.useCallback)((()=>{onChange&&onChange(void 0)}),[onChange]),handleSearch=(0,react.useCallback)((nextQuery=>{if(!customSearchRef.current||nextQuery.trim().length=customSearchMinQueryLength?getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery),optionValueKey):rsuiteData;setControlledRsuiteData(nextControlledRsuiteData)}),[customSearchMinQueryLength,optionValueKey,rsuiteData]),handleSelect=(0,react.useCallback)(((_,selectedItem)=>{close(),onChange&&onChange(selectedItem.optionValue)}),[close,onChange]),renderMenuItem=(0,react.useCallback)((node=>(0,jsx_runtime.jsx)("span",{title:String(node),children:String(node)})),[]),toggle=(0,react.useCallback)((event=>{if(disabled)return;let targetElement=event.target;"path"===targetElement.tagName&&targetElement.parentElement&&(targetElement=targetElement.parentElement),(targetElement.classList.contains("rs-picker-toggle")||targetElement.classList.contains("rs-picker-toggle-value")||targetElement.classList.contains("rs-stack-item")||targetElement.classList.contains("rs-picker-toggle-caret")||targetElement.classList.contains("rs-picker-toggle-placeholder"))&&setIsOpen(!isOpen)}),[isOpen,disabled]),disabledItemValues=(0,react.useMemo)((()=>(controlledRsuiteData??rsuiteData).filter((option=>option.isDisabled)).map((option=>option.value))),[controlledRsuiteData,rsuiteData]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&disabled,onChange),useClickOutsideEffect(boxRef,close,baseContainer),(0,react.useEffect)((()=>{forceUpdate()}),[forceUpdate]),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(Select_Box,{ref:boxRef,$hasError:hasError,onClick:toggle,children:boxRef.current&&(0,jsx_runtime.jsx)(StyledSelectPicker,{$isLight:isLight,cleanable:isCleanable,container:boxRef.current,data:controlledRsuiteData??rsuiteData,disabled,disabledItemValues,id:originalProps.name,onClean:handleClean,onSearch:handleSearch,onSelect:handleSelect,open:isOpen,renderMenuItem,searchable:!!customSearch||searchable,searchBy:customSearch?()=>!0:void 0,value:selectedRsuiteValue,...originalProps},key)}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}Select.displayName="Select";const StyledSelectPicker=(0,styled_components_browser_esm.ZP)(SelectPicker.Z)` > .rs-picker-toggle { background-color: ${p=>p.$isLight?p.theme.color.white:p.theme.color.gainsboro} !important; border: 0; @@ -1691,7 +1691,7 @@ } } } -`;try{Select.displayName="Select",Select.__docgenInfo={description:"",displayName:"Select",props:{baseContainer:{defaultValue:null,description:"Used to pass something else than `window.document` as a base container to attach global events listeners.",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document | null"}},customSearch:{defaultValue:null,description:"",name:"customSearch",required:!1,type:{name:"CustomSearch>"}},customSearchMinQueryLength:{defaultValue:{value:"1"},description:"Minimum search query length required to trigger custom search filtering.",name:"customSearchMinQueryLength",required:!1,type:{name:"number"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isCleanable:{defaultValue:{value:"true"},description:"",name:"isCleanable",required:!1,type:{name:"boolean"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue) => Promisable)"}},optionValueKey:{defaultValue:null,description:"",name:"optionValueKey",required:!1,type:{name:"string | number | symbol"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValueType"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/Select.tsx#Select"]={docgenInfo:Select.__docgenInfo,name:"Select",path:"src/fields/Select.tsx#Select"})}catch(__react_docgen_typescript_loader_error){}function Textarea({className,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,rows=3,style,value,...originalProps}){const inputRef=(0,react.useRef)(),controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-Textarea",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([originalProps.disabled,originalProps.name]),handleChange=(0,react.useCallback)((()=>{if(!onChange)return;const nextValue=inputRef.current.value,normalizedNextValue=nextValue.trim().length?nextValue:void 0;onChange(normalizedNextValue)}),[onChange]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&originalProps.disabled,onChange),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(Textarea_StyledInput,{ref:inputRef,$hasError:hasError,$isLight:isLight,as:"textarea",id:originalProps.name,onChange:handleChange,rows,value:value||"",...originalProps},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}Textarea.displayName="Textarea";const Textarea_StyledInput=(0,styled_components_browser_esm.ZP)(Input.Z)` +`;try{Select.displayName="Select",Select.__docgenInfo={description:"",displayName:"Select",props:{baseContainer:{defaultValue:null,description:"Used to pass something else than `window.document` as a base container to attach global events listeners.",name:"baseContainer",required:!1,type:{name:"HTMLDivElement | Document | null"}},customSearch:{defaultValue:null,description:"",name:"customSearch",required:!1,type:{name:"CustomSearch>"}},customSearchMinQueryLength:{defaultValue:{value:"1"},description:"Minimum search query length required to trigger custom search filtering.",name:"customSearchMinQueryLength",required:!1,type:{name:"number"}},error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isCleanable:{defaultValue:{value:"true"},description:"",name:"isCleanable",required:!1,type:{name:"boolean"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: OptionValue) => Promisable)"}},optionValueKey:{defaultValue:null,description:"",name:"optionValueKey",required:!1,type:{name:"string | number | symbol"}},options:{defaultValue:null,description:"",name:"options",required:!0,type:{name:"Option[]"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"OptionValueType"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/Select.tsx#Select"]={docgenInfo:Select.__docgenInfo,name:"Select",path:"src/fields/Select.tsx#Select"})}catch(__react_docgen_typescript_loader_error){}function Textarea({className,error,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isUndefinedWhenDisabled=!1,label,onChange,rows=3,style,value,...originalProps}){const inputRef=(0,react.useRef)(),controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-Textarea",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([originalProps.disabled,originalProps.name]),handleChange=(0,react.useCallback)((()=>{if(!onChange)return;const nextValue=inputRef.current.value,normalizedNextValue=nextValue.trim().length?nextValue:void 0;onChange(normalizedNextValue)}),[onChange]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&originalProps.disabled,onChange),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsx)(Textarea_StyledInput,{ref:inputRef,$hasError:hasError,$isLight:isLight,as:"textarea",id:originalProps.name,onChange:handleChange,rows,value:value??"",...originalProps},key),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}Textarea.displayName="Textarea";const Textarea_StyledInput=(0,styled_components_browser_esm.ZP)(Input.Z)` background-color: ${p=>p.$isLight?p.theme.color.white:p.theme.color.gainsboro}; border: solid 1px ${p=>p.$hasError?p.theme.color.maximumRed:p.theme.color.gainsboro}; font-size: 13px; @@ -1711,7 +1711,7 @@ border: solid 1px ${p=>p.$hasError?p.theme.color.maximumRed:p.theme.color.blueGray} !important; outline: 0; } -`;try{Textarea.displayName="Textarea",Textarea.__docgenInfo={description:"",displayName:"Textarea",props:{error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: string) => Promisable)"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/Textarea.tsx#Textarea"]={docgenInfo:Textarea.__docgenInfo,name:"Textarea",path:"src/fields/Textarea.tsx#Textarea"})}catch(__react_docgen_typescript_loader_error){}function TextInput({className,error,Icon,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isSearchInput=!1,isUndefinedWhenDisabled=!1,label,onChange,size=constants.$u.NORMAL,style,type="text",value,...originalProps}){const controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-TextInput",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([originalProps.disabled,originalProps.name]),clean=(0,react.useCallback)((()=>{onChange&&onChange(void 0)}),[onChange]),handleChange=(0,react.useCallback)((nextValue=>{if(!onChange)return;const normalizedNextValue=nextValue&&nextValue.trim().length?nextValue:void 0;onChange(normalizedNextValue)}),[onChange]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&originalProps.disabled,onChange),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsxs)(InputBox,{$size:size,children:[(0,jsx_runtime.jsx)(TextInput_StyledInput,{$hasError:hasError,$hasIcon:!!Icon,$isLight:isLight,$size:size,id:originalProps.name,onChange:handleChange,type,value:value||"",...originalProps},key),isSearchInput&&!Icon&&(0,jsx_runtime.jsxs)(IconsContainer,{$size:size,children:[value&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(IconButton.h,{accent:constants.Le.TERTIARY,color:THEME.color.slateGray,Icon:icons.Close,onClick:clean,size:constants.$u.SMALL}),(0,jsx_runtime.jsx)(TextInput_Separator,{})]}),(0,jsx_runtime.jsx)(icons.Search,{color:THEME.color.slateGray})]}),Icon&&(0,jsx_runtime.jsx)(Icon,{color:THEME.color.slateGray})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}TextInput.displayName="TextInput";const PADDING={[constants.$u.LARGE]:"8px 16px 11px",[constants.$u.NORMAL]:"3px 8px 6px",[constants.$u.SMALL]:"3px 8px 6px"},PADDING_WITH_ICON={[constants.$u.LARGE]:"8px 40px 11px 16px",[constants.$u.NORMAL]:"3px 38px 6px 8px",[constants.$u.SMALL]:"3px 38px 6px 8px"},IconsContainer=styled_components_browser_esm.ZP.div` +`;try{Textarea.displayName="Textarea",Textarea.__docgenInfo={description:"",displayName:"Textarea",props:{error:{defaultValue:null,description:"",name:"error",required:!1,type:{name:"string"}},isErrorMessageHidden:{defaultValue:{value:"false"},description:"",name:"isErrorMessageHidden",required:!1,type:{name:"boolean"}},isLabelHidden:{defaultValue:{value:"false"},description:"",name:"isLabelHidden",required:!1,type:{name:"boolean"}},isLight:{defaultValue:{value:"false"},description:"",name:"isLight",required:!1,type:{name:"boolean"}},isUndefinedWhenDisabled:{defaultValue:{value:"false"},description:"",name:"isUndefinedWhenDisabled",required:!1,type:{name:"boolean"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!1,type:{name:"((nextValue: string) => Promisable)"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/fields/Textarea.tsx#Textarea"]={docgenInfo:Textarea.__docgenInfo,name:"Textarea",path:"src/fields/Textarea.tsx#Textarea"})}catch(__react_docgen_typescript_loader_error){}function TextInput({className,error,Icon,isErrorMessageHidden=!1,isLabelHidden=!1,isLight=!1,isSearchInput=!1,isUndefinedWhenDisabled=!1,label,onChange,size=constants.$u.NORMAL,style,type="text",value,...originalProps}){const controlledClassname=(0,react.useMemo)((()=>classnames_default()("Field-TextInput",className)),[className]),controlledError=(0,react.useMemo)((()=>normalizeString(error)),[error]),hasError=(0,react.useMemo)((()=>Boolean(controlledError)),[controlledError]),key=useKey([originalProps.disabled,originalProps.name]),clean=(0,react.useCallback)((()=>{onChange&&onChange(void 0)}),[onChange]),handleChange=(0,react.useCallback)((nextValue=>{if(!onChange)return;const normalizedNextValue=nextValue&&nextValue.trim().length?nextValue:void 0;onChange(normalizedNextValue)}),[onChange]);return useFieldUndefineEffect(isUndefinedWhenDisabled&&originalProps.disabled,onChange),(0,jsx_runtime.jsxs)(Field,{className:controlledClassname,style,children:[(0,jsx_runtime.jsx)(Label,{disabled:originalProps.disabled,hasError,htmlFor:originalProps.name,isHidden:isLabelHidden,children:label}),(0,jsx_runtime.jsxs)(InputBox,{$size:size,children:[(0,jsx_runtime.jsx)(TextInput_StyledInput,{$hasError:hasError,$hasIcon:!!Icon,$isLight:isLight,$size:size,id:originalProps.name,onChange:handleChange,type,value:value??"",...originalProps},key),isSearchInput&&!Icon&&(0,jsx_runtime.jsxs)(IconsContainer,{$size:size,children:[value&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(IconButton.h,{accent:constants.Le.TERTIARY,color:THEME.color.slateGray,Icon:icons.Close,onClick:clean,size:constants.$u.SMALL}),(0,jsx_runtime.jsx)(TextInput_Separator,{})]}),(0,jsx_runtime.jsx)(icons.Search,{color:THEME.color.slateGray})]}),Icon&&(0,jsx_runtime.jsx)(Icon,{color:THEME.color.slateGray})]}),!isErrorMessageHidden&&hasError&&(0,jsx_runtime.jsx)(FieldError,{children:controlledError})]})}TextInput.displayName="TextInput";const PADDING={[constants.$u.LARGE]:"8px 16px 11px",[constants.$u.NORMAL]:"3px 8px 6px",[constants.$u.SMALL]:"3px 8px 6px"},PADDING_WITH_ICON={[constants.$u.LARGE]:"8px 40px 11px 16px",[constants.$u.NORMAL]:"3px 38px 6px 8px",[constants.$u.SMALL]:"3px 38px 6px 8px"},IconsContainer=styled_components_browser_esm.ZP.div` align-items: center; display: flex; position: absolute; @@ -1809,7 +1809,7 @@ padding: 10px; text-overflow: ellipsis; white-space: nowrap; -`,Th};function Td_Td({cell,children}){const controlledChildren=children||(0,build_lib.ie)(cell.column.columnDef.cell,cell.getContext());return(0,jsx_runtime.jsx)(SimpleTable.Td,{$isCenter:!1,style:{maxWidth:150!==cell.column.getSize()?cell.column.getSize():"auto",minWidth:150!==cell.column.getSize()?cell.column.getSize():"auto",width:150!==cell.column.getSize()?cell.column.getSize():"auto"},children:controlledChildren},cell.id)}Td_Td.displayName="Td";try{Td_Td.displayName="Td",Td_Td.__docgenInfo={description:"",displayName:"Td",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"Cell"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/DataTable/Td.tsx#Td"]={docgenInfo:Td_Td.__docgenInfo,name:"Td",path:"src/tables/DataTable/Td.tsx#Td"})}catch(__react_docgen_typescript_loader_error){}const SortingIcon=(0,styled_components_browser_esm.ZP)(icons.Chevron)` +`,Th};function Td_Td({cell,children}){const controlledChildren=children??(0,build_lib.ie)(cell.column.columnDef.cell,cell.getContext());return(0,jsx_runtime.jsx)(SimpleTable.Td,{$isCenter:!1,style:{maxWidth:150!==cell.column.getSize()?cell.column.getSize():"auto",minWidth:150!==cell.column.getSize()?cell.column.getSize():"auto",width:150!==cell.column.getSize()?cell.column.getSize():"auto"},children:controlledChildren},cell.id)}Td_Td.displayName="Td";try{Td_Td.displayName="Td",Td_Td.__docgenInfo={description:"",displayName:"Td",props:{cell:{defaultValue:null,description:"",name:"cell",required:!0,type:{name:"Cell"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/DataTable/Td.tsx#Td"]={docgenInfo:Td_Td.__docgenInfo,name:"Td",path:"src/tables/DataTable/Td.tsx#Td"})}catch(__react_docgen_typescript_loader_error){}const SortingIcon=(0,styled_components_browser_esm.ZP)(icons.Chevron)` cursor: pointer; height: 16px; margin-right: 8px; @@ -1817,7 +1817,7 @@ transform: ${props=>props.$isDescending?"rotate(-180deg)":"rotate(0deg)"}; transition: all 0.5s; width: 16px; -`;function Th_Th({children,header}){const controlledChildren=children||!header.isPlaceholder?(0,jsx_runtime.jsxs)(SimpleTable.SortContainer,{className:header.column.getCanSort()?"cursor-pointer select-none":"",onClick:header.column.getToggleSortingHandler(),children:[(0,build_lib.ie)(header.column.columnDef.header,header.getContext()),header.column.getCanSort()&&({asc:(0,jsx_runtime.jsx)(SortingIcon,{}),desc:(0,jsx_runtime.jsx)(SortingIcon,{$isDescending:!0})}[header.column.getIsSorted()]??(0,jsx_runtime.jsx)(icons.SortingArrows,{size:14}))]}):void 0;return(0,jsx_runtime.jsx)(SimpleTable.Th,{style:{maxWidth:150!==header.column.getSize()?header.column.getSize():"auto",minWidth:150!==header.column.getSize()?header.column.getSize():"auto",width:150!==header.column.getSize()?header.column.getSize():"auto"},children:controlledChildren},header.id)}Th_Th.displayName="Th";try{Th_Th.displayName="Th",Th_Th.__docgenInfo={description:"",displayName:"Th",props:{header:{defaultValue:null,description:"",name:"header",required:!0,type:{name:"Header"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/DataTable/Th.tsx#Th"]={docgenInfo:Th_Th.__docgenInfo,name:"Th",path:"src/tables/DataTable/Th.tsx#Th"})}catch(__react_docgen_typescript_loader_error){}function DataTable({columns,data,initialSorting}){const[sorting,setSorting]=(0,react.useState)(initialSorting),table=(0,build_lib.b7)({columns,data:data||[],enableSortingRemoval:!1,getCoreRowModel:(0,table_core_build_lib.sC)(),getSortedRowModel:(0,table_core_build_lib.tj)(),onSortingChange:setSorting,state:{sorting}}),{rows}=table.getRowModel();return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!data&&(0,jsx_runtime.jsx)("p",{children:"Chargement en cours..."}),data&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!data.length&&(0,jsx_runtime.jsx)("p",{children:"Aucune donnée."}),data.length>0&&(0,jsx_runtime.jsxs)(SimpleTable.Table,{children:[(0,jsx_runtime.jsx)(SimpleTable.Head,{children:table.getHeaderGroups().map((headerGroup=>(0,jsx_runtime.jsx)("tr",{children:headerGroup.headers.map((header=>(0,jsx_runtime.jsx)(Th_Th,{header},header.id)))},headerGroup.id)))}),(0,jsx_runtime.jsx)("tbody",{children:rows.map((row=>(0,jsx_runtime.jsx)(SimpleTable.BodyTr,{"data-id":row.getValue("id"),children:row.getVisibleCells().map((cell=>(0,jsx_runtime.jsx)(Td_Td,{cell},cell.id)))},row.id)))})]})]})]})}try{DataTable.displayName="DataTable",DataTable.__docgenInfo={description:"",displayName:"DataTable",props:{columns:{defaultValue:null,description:"",name:"columns",required:!0,type:{name:"ColumnDef[]"}},data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"T[] | undefined"}},initialSorting:{defaultValue:null,description:"",name:"initialSorting",required:!0,type:{name:"SortingState"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/DataTable/index.tsx#DataTable"]={docgenInfo:DataTable.__docgenInfo,name:"DataTable",path:"src/tables/DataTable/index.tsx#DataTable"})}catch(__react_docgen_typescript_loader_error){}function RowCheckbox_RowCheckbox({className="",disabled=!1,isChecked=!1,isIndeterminate=!1,onChange=()=>{}}){return(0,jsx_runtime.jsx)(Checkbox.Z,{checked:isChecked,className:`${className} cursor-pointer`,disabled,indeterminate:isIndeterminate,onChange:(_,__,event)=>onChange(event)})}RowCheckbox_RowCheckbox.displayName="RowCheckbox";try{RowCheckbox_RowCheckbox.displayName="RowCheckbox",RowCheckbox_RowCheckbox.__docgenInfo={description:"",displayName:"RowCheckbox",props:{className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},isChecked:{defaultValue:{value:"false"},description:"",name:"isChecked",required:!1,type:{name:"boolean"}},isIndeterminate:{defaultValue:{value:"false"},description:"",name:"isIndeterminate",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => undefined"},description:"",name:"onChange",required:!1,type:{name:"((event: ChangeEvent) => void) & FormEventHandler"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/TableWithSelectableRows/RowCheckbox.tsx#RowCheckbox"]={docgenInfo:RowCheckbox_RowCheckbox.__docgenInfo,name:"RowCheckbox",path:"src/tables/TableWithSelectableRows/RowCheckbox.tsx#RowCheckbox"})}catch(__react_docgen_typescript_loader_error){}const TableWithSelectableRows_Table=(0,styled_components_browser_esm.ZP)(SimpleTable.Table)` +`;function Th_Th({children,header}){const controlledChildren=children??!header.isPlaceholder?(0,jsx_runtime.jsxs)(SimpleTable.SortContainer,{className:header.column.getCanSort()?"cursor-pointer select-none":"",onClick:header.column.getToggleSortingHandler(),children:[(0,build_lib.ie)(header.column.columnDef.header,header.getContext()),header.column.getCanSort()&&({asc:(0,jsx_runtime.jsx)(SortingIcon,{}),desc:(0,jsx_runtime.jsx)(SortingIcon,{$isDescending:!0})}[header.column.getIsSorted()]??(0,jsx_runtime.jsx)(icons.SortingArrows,{size:14}))]}):void 0;return(0,jsx_runtime.jsx)(SimpleTable.Th,{style:{maxWidth:150!==header.column.getSize()?header.column.getSize():"auto",minWidth:150!==header.column.getSize()?header.column.getSize():"auto",width:150!==header.column.getSize()?header.column.getSize():"auto"},children:controlledChildren},header.id)}Th_Th.displayName="Th";try{Th_Th.displayName="Th",Th_Th.__docgenInfo={description:"",displayName:"Th",props:{header:{defaultValue:null,description:"",name:"header",required:!0,type:{name:"Header"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/DataTable/Th.tsx#Th"]={docgenInfo:Th_Th.__docgenInfo,name:"Th",path:"src/tables/DataTable/Th.tsx#Th"})}catch(__react_docgen_typescript_loader_error){}function DataTable({columns,data,initialSorting}){const[sorting,setSorting]=(0,react.useState)(initialSorting),table=(0,build_lib.b7)({columns,data:data??[],enableSortingRemoval:!1,getCoreRowModel:(0,table_core_build_lib.sC)(),getSortedRowModel:(0,table_core_build_lib.tj)(),onSortingChange:setSorting,state:{sorting}}),{rows}=table.getRowModel();return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!data&&(0,jsx_runtime.jsx)("p",{children:"Chargement en cours..."}),data&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[!data.length&&(0,jsx_runtime.jsx)("p",{children:"Aucune donnée."}),data.length>0&&(0,jsx_runtime.jsxs)(SimpleTable.Table,{children:[(0,jsx_runtime.jsx)(SimpleTable.Head,{children:table.getHeaderGroups().map((headerGroup=>(0,jsx_runtime.jsx)("tr",{children:headerGroup.headers.map((header=>(0,jsx_runtime.jsx)(Th_Th,{header},header.id)))},headerGroup.id)))}),(0,jsx_runtime.jsx)("tbody",{children:rows.map((row=>(0,jsx_runtime.jsx)(SimpleTable.BodyTr,{"data-id":row.getValue("id"),children:row.getVisibleCells().map((cell=>(0,jsx_runtime.jsx)(Td_Td,{cell},cell.id)))},row.id)))})]})]})]})}try{DataTable.displayName="DataTable",DataTable.__docgenInfo={description:"",displayName:"DataTable",props:{columns:{defaultValue:null,description:"",name:"columns",required:!0,type:{name:"ColumnDef[]"}},data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"T[] | undefined"}},initialSorting:{defaultValue:null,description:"",name:"initialSorting",required:!0,type:{name:"SortingState"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/DataTable/index.tsx#DataTable"]={docgenInfo:DataTable.__docgenInfo,name:"DataTable",path:"src/tables/DataTable/index.tsx#DataTable"})}catch(__react_docgen_typescript_loader_error){}function RowCheckbox_RowCheckbox({className="",disabled=!1,isChecked=!1,isIndeterminate=!1,onChange=()=>{}}){return(0,jsx_runtime.jsx)(Checkbox.Z,{checked:isChecked,className:`${className} cursor-pointer`,disabled,indeterminate:isIndeterminate,onChange:(_,__,event)=>onChange(event)})}RowCheckbox_RowCheckbox.displayName="RowCheckbox";try{RowCheckbox_RowCheckbox.displayName="RowCheckbox",RowCheckbox_RowCheckbox.__docgenInfo={description:"",displayName:"RowCheckbox",props:{className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},isChecked:{defaultValue:{value:"false"},description:"",name:"isChecked",required:!1,type:{name:"boolean"}},isIndeterminate:{defaultValue:{value:"false"},description:"",name:"isIndeterminate",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => undefined"},description:"",name:"onChange",required:!1,type:{name:"((event: ChangeEvent) => void) & FormEventHandler"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/TableWithSelectableRows/RowCheckbox.tsx#RowCheckbox"]={docgenInfo:RowCheckbox_RowCheckbox.__docgenInfo,name:"RowCheckbox",path:"src/tables/TableWithSelectableRows/RowCheckbox.tsx#RowCheckbox"})}catch(__react_docgen_typescript_loader_error){}const TableWithSelectableRows_Table=(0,styled_components_browser_esm.ZP)(SimpleTable.Table)` border-collapse: separate; border-spacing: 0 5px; table-layout: fixed; @@ -1852,4 +1852,4 @@ border-right: ${p=>p.$hasRightBorder?`1px solid ${p.theme.color.lightGray}`:""}; width: ${p=>p.$width}px; `,Th:TableWithSelectableRows_Th};try{RowCheckbox.displayName="RowCheckbox",RowCheckbox.__docgenInfo={description:"",displayName:"RowCheckbox",props:{className:{defaultValue:{value:""},description:"",name:"className",required:!1,type:{name:"string"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},isChecked:{defaultValue:{value:"false"},description:"",name:"isChecked",required:!1,type:{name:"boolean"}},isIndeterminate:{defaultValue:{value:"false"},description:"",name:"isIndeterminate",required:!1,type:{name:"boolean"}},onChange:{defaultValue:{value:"() => undefined"},description:"",name:"onChange",required:!1,type:{name:"((event: ChangeEvent) => void) & FormEventHandler"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/tables/TableWithSelectableRows/index.tsx#RowCheckbox"]={docgenInfo:RowCheckbox.__docgenInfo,name:"RowCheckbox",path:"src/tables/TableWithSelectableRows/index.tsx#RowCheckbox"})}catch(__react_docgen_typescript_loader_error){}var esm_exports=__webpack_require__("./node_modules/@sentry/core/esm/exports.js");function logSoftError({context={},isSideWindowError=!1,message,originalError,userMessage}){console.group(`Soft Error: ${message}`),console.debug("context",context),console.debug("originalError",originalError),console.groupEnd();const extra=originalError?{...context,originalError}:{...context};(0,esm_exports.uT)(message,{extra,level:"warning"}),userMessage&&window.document.dispatchEvent(new NotificationEvent(userMessage,"error",isSideWindowError))}},"./src/utils/stopMouseEventPropagation.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function stopMouseEventPropagation(event){event.stopPropagation()}__webpack_require__.d(__webpack_exports__,{k:()=>stopMouseEventPropagation})},"./node_modules/@storybook/builder-webpack5/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/assets/stylesheets/rsuite-override.css":(module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var _node_modules_storybook_builder_webpack5_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/builder-webpack5/node_modules/css-loader/dist/runtime/sourceMaps.js"),_node_modules_storybook_builder_webpack5_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_node_modules_storybook_builder_webpack5_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__),_node_modules_storybook_builder_webpack5_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@storybook/builder-webpack5/node_modules/css-loader/dist/runtime/api.js"),___CSS_LOADER_EXPORT___=__webpack_require__.n(_node_modules_storybook_builder_webpack5_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_storybook_builder_webpack5_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default());___CSS_LOADER_EXPORT___.push([module.id,"/* variables */\n:root {\n /* colors */\n --gunMetal: #282f3e;\n --charcoal: #3b4559;\n --slateGray: #707785;\n --lightGray: #cccfd6;\n --gainsboro: #e5e5eb;\n --cultured: #f7f7fa;\n --white: #ffffff;\n\n --blue-yonder: #567a9e;\n --blue-yonder-25: #d4dde7;\n --blue-gray: #5697d2;\n --blue-gray-25: #d4e5f4;\n\n --mediumSeaGreen: #29b361;\n --golden-poppy: #fac11a;\n --maximum-red: #e1000f;\n\n --cadet-grey: #8e9a9f;\n --grullo: #b89b8c;\n --copper-red: #cf6a4e;\n --chinese-red: #a13112;\n\n --powder-blue: #9ed7d9;\n --wheat: #edd6a4;\n --opal: #a5bcc0;\n\n /* text */\n --rs-text-primary: var(--gunMetal);\n\n /* btn vars */\n --rs-btn-primary-text: var(--white);\n --rs-btn-primary-bg: var(--charcoal);\n --rs-btn-default-bg: transparent;\n --rs-btn-primary-hover-bg: var(--blue-yonder);\n --rs-btn-link-text: var(--slateGray);\n --rs-btn-link-hover-text: var(--blue-yonder);\n --rs-btn-link-active-text: var(--blue-gray);\n --rs-btn-ghost-text: var(--charcoal);\n --rs-btn-ghost-border: var(--charcoal);\n --rs-btn-ghost-hover-border: var(--blue-yonder);\n --rs-btn-ghost-hover-text: var(--blue-yonder);\n --rs-iconbtn-addon: transparent;\n\n --rs-iconbtn-primary-addon: var(--charcoal);\n --rs-btn-default-hover-bg: var(--blue-yonder);\n --rs-iconbtn-activated-addon: var(--blue-yonder);\n --rs-btn-default-hover-text: var(--white);\n --rs-iconbtn-primary-activated-addon: var(--blue-yonder);\n --rs-btn-primary-active-bg: var(--blue-gray);\n --rs-iconbtn-primary-pressed-addon: var(--blue-gray);\n --rs-btn-ghost-active-text: var(--blue-gray);\n --rs-btn-subtle-text: var(--gunMetal);\n --rs-btn-subtle-hover-bg: transparent;\n --rs-btn-subtle-hover-text: var(--blue-yonder);\n --rs-btn-subtle-active-bg: transparent;\n --rs-btn-subtle-active-text: var(--blue-gray);\n\n /* Checkbox vars */\n --rs-checkbox-disabled-bg: var(--white);\n\n --rs-menuitem-active-text: var(--blue-gray);\n --rs-listbox-option-hover-bg: var(--blue-yonder-25);\n --rs-listbox-option-selected-bg: var(--blue-gray-25);\n /* tags */\n --rs-tag-bg: var(--gainsboro);\n\n /* toggle */\n --rs-toggle-checked-bg: var(--charcoal);\n --rs-toggle-checked-hover-bg: var(--gunMetal);\n}\n\nlabel {\n color: var(--slateGray);\n font-size: 13px;\n line-height: 18px;\n}\n\n.rs-picker-toggle-active,\n.rs-picker.rs-picker-focused {\n box-shadow: none;\n border: 1px solid var(--blue-gray) !important;\n border-radius: 0;\n}\n\n/* button */\n.rs-ripple-pond {\n height: 30px;\n}\n\n.rs-btn {\n line-height: 18px;\n padding-top: 6px;\n padding-bottom: 6px;\n border-radius: 0;\n}\n\n.rs-btn-sm {\n padding-top: 3px;\n padding-bottom: 3px;\n font-size: 15px;\n}\n\n.rs-btn-md {\n height: 30px;\n}\n\n.rs-btn-icon-with-text.rs-btn-md.rs-btn-icon-placement-left,\n.rs-btn-icon-with-text.rs-btn.rs-btn-icon-placement-left {\n padding-left: 32px;\n padding-top: 6px;\n padding-bottom: 6px;\n}\n\n.rs-btn-icon-with-text.rs-btn-sm.rs-btn-icon-placement-left {\n padding-top: 3px;\n padding-bottom: 3px;\n}\n\n.rs-btn-ghost:hover {\n background-color: transparent;\n}\n\n.rs-btn-ghost.rs-btn-active,\n.rs-btn-ghost:active {\n background-color: var(--blue-gray-25);\n border-color: var(--blue-gray);\n}\n\n.rs-btn-ghost.rs-btn-icon-with-text:hover > .rs-icon {\n background-color: transparent;\n}\n\n.rs-btn-icon-with-text:focus > .rs-icon,\n.rs-btn-icon-with-text:hover > .rs-icon {\n background-color: transparent;\n}\n\n.rs-btn-ghost.rs-btn,\n.rs-btn-ghost.rs-btn-md,\n.rs-btn-icon-with-text.rs-btn-md.rs-btn-icon-placement-left.rs-btn-ghost,\n.rs-btn-icon-with-text.rs-btn.rs-btn-icon-placement-left.rs-btn-ghost {\n padding-top: 5px;\n padding-bottom: 5px;\n}\n\n.rs-btn-ghost.rs-btn-sm,\n.rs-btn-icon-with-text.rs-btn-sm.rs-btn-icon-placement-left.rs-btn-ghost {\n padding-top: 2px;\n padding-bottom: 2px;\n}\n\n.rs-btn-icon.rs-btn,\n.rs-btn-icon.rs-btn-md {\n padding: 5px;\n}\n\n.rs-btn-subtle.rs-btn-icon.rs-btn-md {\n padding: 0;\n}\n\n.rs-btn-icon.rs-btn-sm {\n padding: 0px;\n}\n\n.rs-btn-icon.rs-btn-lg {\n padding: 7px;\n height: 40px;\n}\n\n.rs-btn-icon.rs-btn-ghost {\n padding: 4px;\n}\n\n.rs-btn-icon.rs-btn-lg.rs-btn-ghost {\n padding: 6px;\n}\n\n.rs-btn-icon-with-text.rs-btn-sm {\n padding-top: 5px;\n padding-bottom: 4px;\n line-height: 15px;\n font-size: 11px;\n}\n\n.rs-btn-icon.rs-btn > .rs-icon,\n.rs-btn-icon.rs-btn-md > .rs-icon {\n width: 20px;\n height: 20px;\n}\n\n.rs-btn-icon.rs-btn-lg > .rs-icon {\n width: 26px;\n height: 26px;\n}\n\n.rs-btn-icon.rs-btn-sm > .rs-icon {\n width: 14px;\n height: 14px;\n font-size: 14px;\n}\n\n.rs-btn-icon-with-text.rs-btn {\n line-height: 18px;\n}\n\n.rs-btn-icon-with-text.rs-btn > .rs-icon {\n width: 30px;\n height: 30px;\n padding: 5px;\n}\n\n.rs-btn-icon-with-text.rs-btn-sm > .rs-icon {\n width: 24px;\n height: 24px;\n padding: 4px;\n}\n\n.rs-btn-link,\n.rs-btn-link.rs-btn-md {\n font-size: 13px;\n text-decoration: underline;\n}\n\n.rs-btn-link.rs-btn-disabled,\n.rs-btn-link:disabled {\n text-decoration: underline;\n}\n\n.rs-btn-link.rs-btn-sm {\n font-size: 11px;\n}\n\n/* checkbox */\n.rs-checkbox-wrapper {\n top: 8px !important;\n}\n\n.rs-checkbox-checker {\n padding-bottom: 0;\n padding-left: 36px;\n}\n\n.rs-checkbox label {\n font-weight: 500;\n}\n\n.rs-checkbox-checker > label {\n font-size: 13px;\n color: var(--gunMetal);\n}\n\n.rs-checkbox-wrapper .rs-checkbox-inner::before {\n border: 2px solid var(--lightGray);\n background: var(--gainsboro) 0% 0% no-repeat padding-box;\n border-radius: 0px;\n}\n\n.rs-checkbox-wrapper .rs-checkbox-inner::after {\n border-color: var(--lightGray);\n border-width: 0 0 2px;\n -webkit-transform: rotate(0deg) scale(1);\n transform: rotate(0deg) scale(1);\n margin-top: -1px;\n}\n\n.rs-checkbox-indeterminate .rs-checkbox-wrapper .rs-checkbox-inner::before {\n background-color: var(--charcoal);\n border-color: var(--charcoal);\n}\n\n.rs-checkbox-indeterminate .rs-checkbox-wrapper .rs-checkbox-inner::after {\n border-color: var(--white);\n border-width: 0 0 2px;\n -webkit-transform: rotate(0deg) scale(1);\n transform: rotate(0deg) scale(1);\n margin-top: 0px;\n}\n\n.rs-checkbox-disabled:not(.rs-checkbox-checked):not(.rs-checkbox-indeterminate)\n .rs-checkbox-wrapper\n .rs-checkbox-inner:before {\n border-color: var(--lightGray);\n}\n\n.rs-checkbox-checked .rs-checkbox-wrapper .rs-checkbox-inner::before {\n border-color: var(--charcoal);\n background-color: var(--charcoal);\n}\n\nlabel:hover .rs-checkbox-wrapper .rs-checkbox-inner:before {\n border-color: var(--blue-yonder);\n background: var(--blue-yonder-25) 0% 0% no-repeat padding-box;\n}\n\n.rs-checkbox-checked label:hover .rs-checkbox-wrapper .rs-checkbox-inner:before {\n border-color: var(--blue-yonder);\n background: var(--blue-yonder) 0% 0% no-repeat padding-box;\n}\n\n.rs-checkbox-checked .rs-checkbox-wrapper .rs-checkbox-inner::after {\n border: solid var(--white);\n border-width: 0 2px 2px 0;\n}\n\n.checkbox-hidden > div > label > .rs-checkbox-wrapper {\n opacity: 0 !important;\n margin-left: -40px;\n position: inherit;\n}\n\n/* radio */\n\n.rs-radio-wrapper::before,\n.rs-radio-wrapper .rs-radio-inner::before,\n.rs-radio-wrapper {\n width: 14px;\n height: 14px;\n}\n\n.rs-radio-wrapper .rs-radio-inner::before {\n background: var(--gainsboro);\n border-width: 2px;\n}\n\n.rs-radio-checked .rs-radio-wrapper .rs-radio-inner::before {\n background: var(--gainsboro);\n border-color: var(--charcoal);\n}\n\n/* center of radio button when checked */\n.rs-radio-wrapper .rs-radio-inner::after {\n background: var(--charcoal);\n width: 6px;\n height: 6px;\n margin-top: 4px;\n margin-left: 4px;\n}\n\n.rs-radio.rs-radio-disabled .rs-radio-wrapper .rs-radio-inner::after {\n background: var(--lightGray);\n}\n\n.rs-radio.rs-radio-disabled .rs-radio-inner:before {\n background: var(--white);\n border-color: var(--lightGray);\n}\n\n.rs-radio-checker > label {\n color: var(--charcoal);\n font-weight: 500;\n line-height: 17px;\n}\n\n.rs-radio:hover .rs-radio-inner:before {\n border-color: var(--charcoal);\n}\n\n/* form */\n.rs-form:not(.rs-form-inline) .rs-form-group:not(:last-child) {\n margin-bottom: 32px;\n}\n\n/* Tags */\n\n.rs-tag-default {\n font-weight: 500;\n}\n\n.rs-tag-closable.rs-tag-md {\n padding-right: 32px;\n}\n\n.rs-tag-md {\n font-size: 13px;\n line-height: 18px;\n border-radius: 0px;\n padding-top: 1px;\n padding-bottom: 3px;\n}\n\n/* TagPicker */\n.rs-picker-tag .rs-tag {\n max-width: calc(100% - 30px) !important;\n background-color: var(--white);\n}\n\n.rs-tag-md .rs-tag-icon-close {\n padding: 6px 6px;\n}\n\n.rs-tag-icon-close.rs-btn-close {\n border-left: 1px solid var(--lightGray);\n}\n\n.rs-picker-tag .rs-picker-toggle.rs-btn-sm ~ .rs-picker-tag-wrapper .rs-tag {\n margin-top: 3px;\n}\n\n/* */\n.rs-modal-lg {\n width: 1300px;\n}\n\n.rs-slider-mark {\n font-size: 13px;\n color: var(--slateGray);\n}\n\n.rs-slider {\n position: absolute;\n width: 341px;\n margin-top: -19px;\n}\n\n.rs-slider-bar {\n height: 0;\n}\n\n.rs-slider-progress-bar {\n height: 2px;\n background: none;\n}\n\n.rs-slider-graduator > ul > li::before {\n visibility: hidden;\n}\n\n.rs-slider-graduator > ul > li:last-child::after,\n.rs-slider-graduator > ul > li::before {\n top: -3px;\n border: none;\n}\n\n.rs-slider-handle::before {\n background: var(--lightGray);\n border: unset;\n top: -6px;\n margin-left: -5px;\n width: 16px;\n height: 16px;\n}\n\n.rs-slider-graduator {\n margin-left: -5px;\n margin-top: -10px;\n}\n\n.rs-slider-graduated > div:nth-child(2)::before {\n background: #9095a2;\n z-index: 99;\n}\n\n.rs-slider-graduated > div:nth-child(2) {\n z-index: 9999;\n}\n\n.rs-slider-graduated > div:nth-child(3)::before {\n background: var(--charcoal);\n z-index: 99;\n}\n\n.rs-picker-menu {\n border-radius: 0;\n z-index: 9999 !important;\n}\n\n.rs-picker-default:not(.rs-picker-disabled) .rs-btn:hover,\n.rs-picker-default:not(.rs-picker-disabled) .rs-picker-toggle:hover,\n.rs-picker-default:not(.rs-picker-disabled) .rs-btn.active,\n.rs-picker-default:not(.rs-picker-disabled) .rs-picker-toggle.active {\n border-color: var(--slateGray) !important;\n}\n\n.rs-table:not(.rs-table-column-resizing) .rs-table-cell-header .rs-table-cell:hover ~ .rs-table-column-resize-spanner,\n.rs-table:not(.rs-table-column-resizing) .rs-table-column-resize-spanner:hover {\n background-color: var(--slateGray);\n}\n\n.rs-table-column-resize-spanner::before {\n border-color: transparent var(--slateGray) transparent transparent;\n}\n\n.rs-picker-toolbar-right-btn-ok {\n padding: 5px 10px;\n font-size: 13px;\n line-height: 1.42857143;\n border-radius: 2px;\n color: #fff;\n background-color: var(--charcoal);\n}\n\n.rs-picker-toolbar-right-btn-ok.rs-picker-toolbar-btn-disabled,\n.rs-picker-toolbar-right-btn-ok.rs-picker-toolbar-btn-disabled:hover,\n.rs-picker-toolbar-right-btn-ok.rs-picker-toolbar-btn-disabled:hover:active {\n background-color: var(--charcoal);\n}\n\n.rs-picker-toolbar-right-btn-ok:not(.rs-btn-disabled):hover {\n background-color: var(--charcoal);\n}\n\n.rs-modal-body {\n padding: 20px 25px 0 25px !important;\n}\n\n.rs-table-body-info {\n font-size: 13px;\n color: var(--slateGray);\n}\n\n.rs-modal-full .rs-modal-dialog {\n width: 100%;\n margin-left: 0;\n}\n\n.rs-modal-content {\n padding: 0;\n border-radius: 2px;\n}\n\n.rs-modal-body {\n padding: 20px 25px 20px 25px;\n margin-top: 0;\n max-height: 800px !important;\n min-height: 210px !important;\n}\n\n.rs-modal-header {\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n padding: 5px 14px 8px 14px;\n background: var(--charcoal);\n}\n\n.rs-modal-header .rs-modal-title {\n color: #f0f0f0;\n font-size: 22px;\n font-weight: normal;\n}\n\n.rs-table-cell-header,\n.rs-table-cell[role='columnheader'],\n.rs-table-cell-header:focus,\n.rs-table-cell[role='columnheader']:focus,\n.rs-table-cell-header:hover,\n.rs-table-cell[role='columnheader']:hover {\n background: var(--gainsboro);\n color: white;\n}\n\n.ghost .rs-picker-toggle.rs-btn.rs-btn-default {\n background-color: var(--white) !important;\n}\n\n.rs-table-hover .rs-table-row-header:hover .rs-table-cell-group,\n.rs-table-hover .rs-table-row-header:hover .rs-table-cell {\n background: var(--gainsboro);\n}\n\n.rs-table-cell[role='columnheader'] > .rs-table-cell-content {\n color: var(--slateGray);\n}\n\n.rs-table-cell {\n border: 1px solid #e0e0e0;\n}\n\n.rs-table-cell-content {\n font-size: 13px;\n font-weight: 500;\n color: var(--gunMetal);\n text-align: left;\n}\n\n.rs-table-cell-content > input {\n border: none;\n width: inherit;\n background: none;\n padding-left: 15px;\n font-size: 13px;\n font-weight: normal;\n color: var(--gunMetal);\n}\n\n.rs-table-scrollbar-handle,\n.rs-table-scrollbar-handle:hover,\n.rs-table-scrollbar-handle:focus {\n position: absolute;\n background-color: #575757;\n border-radius: 4px;\n}\n\n.rs-table-cell-content > .rs-checkbox {\n margin-top: -10px;\n margin-left: -10px;\n}\n\n.rs-modal-header-close {\n background: unset;\n right: 10px !important;\n top: 9px !important;\n font-size: 15px !important;\n color: var(--gainsboro) !important;\n}\n\n.rs-picker-tag-wrapper {\n padding-bottom: 0;\n}\n\n.rs-picker-input {\n border-radius: 0;\n vertical-align: top;\n}\n\n.rs-picker-toggle-placeholder {\n font-size: 11px;\n color: var(--slateGray) !important;\n}\n\n.rs-picker-has-value .rs-btn .rs-picker-toggle-value,\n.rs-picker-has-value .rs-picker-toggle .rs-picker-toggle-value {\n color: var(--gunMetal);\n font-size: 13px;\n font-weight: normal;\n}\n\n.rs-picker-select-menu-item.rs-picker-select-menu-item-active,\n.rs-picker-select-menu-item.rs-picker-select-menu-item-active:hover,\n.rs-picker-select-menu-item:not(.rs-picker-select-menu-item-disabled):hover,\n.rs-picker-select-menu-item.rs-picker-select-menu-item-focus,\n.rs-picker-select-menu-item {\n color: var(--slateGray);\n font-size: 13px;\n font-weight: normal;\n}\n\n.rs-picker-select-menu-item {\n padding: 4px 12px;\n}\n\n.grouped .rs-picker-select-menu-item {\n padding-left: 0px;\n}\n\n.rs-picker-select-menu-items {\n margin-bottom: 0;\n}\n\n.rs-picker-select-menu-items.rs-picker-select-menu-group.rs-picker-select-menu-group-title {\n font-size: 13px;\n color: var(--slateGray);\n}\n\n.rs-picker-toggle-clean,\n.rs-picker-toggle-caret {\n color: var(--slateGray);\n}\n\n.rs-picker-check-menu-group[role='listitem'] {\n height: 48px !important;\n}\n\n.rs-picker-check-menu-items .rs-picker-check-menu-group:not(:first-child) {\n padding-top: 0px !important;\n}\n\n.rs-picker-check-menu.rs-picker-check-menu-items {\n max-height: 200px !important;\n}\n\n.rs-table-cell-header .rs-table-cell-content {\n padding: 10px 7px;\n}\n\n.rs-table-cell-header-icon-sort {\n color: var(--slateGray);\n line-height: 1.66666667;\n position: absolute;\n right: 9px;\n top: 10px;\n}\n\n.rs-table-cell-header-icon-sort-asc::after {\n color: var(--slateGray);\n}\n\n.rs-table-cell-header-icon-sort-desc::after {\n color: var(--slateGray);\n}\n\n.rs-table-hover .rs-table-row:not(.rs-table-row-header):hover,\n.rs-table-hover .rs-table-row:hover .rs-table-cell-group,\n.rs-table-hover .rs-table-row:hover .rs-table-cell {\n background: var(--blue-yonder-25) !important;\n}\n\n.rs-table-cell,\n.rs-table-cell-group,\n.rs-table-row {\n -webkit-transition: background-color 0.1s linear !important;\n transition: background-color 0.1s linear !important;\n}\n\n.rs-table-row-expanded {\n height: 100px !important;\n background: white !important;\n}\n\n.rs-plaintext {\n font-size: 13px !important;\n}\n","",{version:3,sources:["webpack://./src/assets/stylesheets/rsuite-override.css"],names:[],mappings:"AAAA,cAAc;AACd;EACE,WAAW;EACX,mBAAmB;EACnB,mBAAmB;EACnB,oBAAoB;EACpB,oBAAoB;EACpB,oBAAoB;EACpB,mBAAmB;EACnB,gBAAgB;;EAEhB,sBAAsB;EACtB,yBAAyB;EACzB,oBAAoB;EACpB,uBAAuB;;EAEvB,yBAAyB;EACzB,uBAAuB;EACvB,sBAAsB;;EAEtB,qBAAqB;EACrB,iBAAiB;EACjB,qBAAqB;EACrB,sBAAsB;;EAEtB,sBAAsB;EACtB,gBAAgB;EAChB,eAAe;;EAEf,SAAS;EACT,kCAAkC;;EAElC,aAAa;EACb,mCAAmC;EACnC,oCAAoC;EACpC,gCAAgC;EAChC,6CAA6C;EAC7C,oCAAoC;EACpC,4CAA4C;EAC5C,2CAA2C;EAC3C,oCAAoC;EACpC,sCAAsC;EACtC,+CAA+C;EAC/C,6CAA6C;EAC7C,+BAA+B;;EAE/B,2CAA2C;EAC3C,6CAA6C;EAC7C,gDAAgD;EAChD,yCAAyC;EACzC,wDAAwD;EACxD,4CAA4C;EAC5C,oDAAoD;EACpD,4CAA4C;EAC5C,qCAAqC;EACrC,qCAAqC;EACrC,8CAA8C;EAC9C,sCAAsC;EACtC,6CAA6C;;EAE7C,kBAAkB;EAClB,uCAAuC;;EAEvC,2CAA2C;EAC3C,mDAAmD;EACnD,oDAAoD;EACpD,SAAS;EACT,6BAA6B;;EAE7B,WAAW;EACX,uCAAuC;EACvC,6CAA6C;AAC/C;;AAEA;EACE,uBAAuB;EACvB,eAAe;EACf,iBAAiB;AACnB;;AAEA;;EAEE,gBAAgB;EAChB,6CAA6C;EAC7C,gBAAgB;AAClB;;AAEA,WAAW;AACX;EACE,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,YAAY;AACd;;AAEA;;EAEE,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;;EAEE,qCAAqC;EACrC,8BAA8B;AAChC;;AAEA;EACE,6BAA6B;AAC/B;;AAEA;;EAEE,6BAA6B;AAC/B;;AAEA;;;;EAIE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;;EAEE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;;EAEE,YAAY;AACd;;AAEA;EACE,UAAU;AACZ;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,iBAAiB;EACjB,eAAe;AACjB;;AAEA;;EAEE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,eAAe;AACjB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,YAAY;AACd;;AAEA;;EAEE,eAAe;EACf,0BAA0B;AAC5B;;AAEA;;EAEE,0BAA0B;AAC5B;;AAEA;EACE,eAAe;AACjB;;AAEA,aAAa;AACb;EACE,mBAAmB;AACrB;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,eAAe;EACf,sBAAsB;AACxB;;AAEA;EACE,kCAAkC;EAClC,wDAAwD;EACxD,kBAAkB;AACpB;;AAEA;EACE,8BAA8B;EAC9B,qBAAqB;EACrB,wCAAwC;EACxC,gCAAgC;EAChC,gBAAgB;AAClB;;AAEA;EACE,iCAAiC;EACjC,6BAA6B;AAC/B;;AAEA;EACE,0BAA0B;EAC1B,qBAAqB;EACrB,wCAAwC;EACxC,gCAAgC;EAChC,eAAe;AACjB;;AAEA;;;EAGE,8BAA8B;AAChC;;AAEA;EACE,6BAA6B;EAC7B,iCAAiC;AACnC;;AAEA;EACE,gCAAgC;EAChC,6DAA6D;AAC/D;;AAEA;EACE,gCAAgC;EAChC,0DAA0D;AAC5D;;AAEA;EACE,0BAA0B;EAC1B,yBAAyB;AAC3B;;AAEA;EACE,qBAAqB;EACrB,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA,UAAU;;AAEV;;;EAGE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,4BAA4B;EAC5B,iBAAiB;AACnB;;AAEA;EACE,4BAA4B;EAC5B,6BAA6B;AAC/B;;AAEA,wCAAwC;AACxC;EACE,2BAA2B;EAC3B,UAAU;EACV,WAAW;EACX,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,wBAAwB;EACxB,8BAA8B;AAChC;;AAEA;EACE,sBAAsB;EACtB,gBAAgB;EAChB,iBAAiB;AACnB;;AAEA;EACE,6BAA6B;AAC/B;;AAEA,SAAS;AACT;EACE,mBAAmB;AACrB;;AAEA,SAAS;;AAET;EACE,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,eAAe;EACf,iBAAiB;EACjB,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA,cAAc;AACd;EACE,uCAAuC;EACvC,8BAA8B;AAChC;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,eAAe;AACjB;;AAEA,IAAI;AACJ;EACE,aAAa;AACf;;AAEA;EACE,eAAe;EACf,uBAAuB;AACzB;;AAEA;EACE,kBAAkB;EAClB,YAAY;EACZ,iBAAiB;AACnB;;AAEA;EACE,SAAS;AACX;;AAEA;EACE,WAAW;EACX,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;;EAEE,SAAS;EACT,YAAY;AACd;;AAEA;EACE,4BAA4B;EAC5B,aAAa;EACb,SAAS;EACT,iBAAiB;EACjB,WAAW;EACX,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,iBAAiB;AACnB;;AAEA;EACE,mBAAmB;EACnB,WAAW;AACb;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,2BAA2B;EAC3B,WAAW;AACb;;AAEA;EACE,gBAAgB;EAChB,wBAAwB;AAC1B;;AAEA;;;;EAIE,yCAAyC;AAC3C;;AAEA;;EAEE,kCAAkC;AACpC;;AAEA;EACE,kEAAkE;AACpE;;AAEA;EACE,iBAAiB;EACjB,eAAe;EACf,uBAAuB;EACvB,kBAAkB;EAClB,WAAW;EACX,iCAAiC;AACnC;;AAEA;;;EAGE,iCAAiC;AACnC;;AAEA;EACE,iCAAiC;AACnC;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,eAAe;EACf,uBAAuB;AACzB;;AAEA;EACE,WAAW;EACX,cAAc;AAChB;;AAEA;EACE,UAAU;EACV,kBAAkB;AACpB;;AAEA;EACE,4BAA4B;EAC5B,aAAa;EACb,4BAA4B;EAC5B,4BAA4B;AAC9B;;AAEA;EACE,2BAA2B;EAC3B,4BAA4B;EAC5B,0BAA0B;EAC1B,2BAA2B;AAC7B;;AAEA;EACE,cAAc;EACd,eAAe;EACf,mBAAmB;AACrB;;AAEA;;;;;;EAME,4BAA4B;EAC5B,YAAY;AACd;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;;EAEE,4BAA4B;AAC9B;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,eAAe;EACf,gBAAgB;EAChB,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,cAAc;EACd,gBAAgB;EAChB,kBAAkB;EAClB,eAAe;EACf,mBAAmB;EACnB,sBAAsB;AACxB;;AAEA;;;EAGE,kBAAkB;EAClB,yBAAyB;EACzB,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;EACjB,sBAAsB;EACtB,mBAAmB;EACnB,0BAA0B;EAC1B,kCAAkC;AACpC;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,eAAe;EACf,kCAAkC;AACpC;;AAEA;;EAEE,sBAAsB;EACtB,eAAe;EACf,mBAAmB;AACrB;;AAEA;;;;;EAKE,uBAAuB;EACvB,eAAe;EACf,mBAAmB;AACrB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,eAAe;EACf,uBAAuB;AACzB;;AAEA;;EAEE,uBAAuB;AACzB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,4BAA4B;AAC9B;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,uBAAuB;EACvB,uBAAuB;EACvB,kBAAkB;EAClB,UAAU;EACV,SAAS;AACX;;AAEA;EACE,uBAAuB;AACzB;;AAEA;EACE,uBAAuB;AACzB;;AAEA;;;EAGE,4CAA4C;AAC9C;;AAEA;;;EAGE,2DAA2D;EAC3D,mDAAmD;AACrD;;AAEA;EACE,wBAAwB;EACxB,4BAA4B;AAC9B;;AAEA;EACE,0BAA0B;AAC5B",sourcesContent:["/* variables */\n:root {\n /* colors */\n --gunMetal: #282f3e;\n --charcoal: #3b4559;\n --slateGray: #707785;\n --lightGray: #cccfd6;\n --gainsboro: #e5e5eb;\n --cultured: #f7f7fa;\n --white: #ffffff;\n\n --blue-yonder: #567a9e;\n --blue-yonder-25: #d4dde7;\n --blue-gray: #5697d2;\n --blue-gray-25: #d4e5f4;\n\n --mediumSeaGreen: #29b361;\n --golden-poppy: #fac11a;\n --maximum-red: #e1000f;\n\n --cadet-grey: #8e9a9f;\n --grullo: #b89b8c;\n --copper-red: #cf6a4e;\n --chinese-red: #a13112;\n\n --powder-blue: #9ed7d9;\n --wheat: #edd6a4;\n --opal: #a5bcc0;\n\n /* text */\n --rs-text-primary: var(--gunMetal);\n\n /* btn vars */\n --rs-btn-primary-text: var(--white);\n --rs-btn-primary-bg: var(--charcoal);\n --rs-btn-default-bg: transparent;\n --rs-btn-primary-hover-bg: var(--blue-yonder);\n --rs-btn-link-text: var(--slateGray);\n --rs-btn-link-hover-text: var(--blue-yonder);\n --rs-btn-link-active-text: var(--blue-gray);\n --rs-btn-ghost-text: var(--charcoal);\n --rs-btn-ghost-border: var(--charcoal);\n --rs-btn-ghost-hover-border: var(--blue-yonder);\n --rs-btn-ghost-hover-text: var(--blue-yonder);\n --rs-iconbtn-addon: transparent;\n\n --rs-iconbtn-primary-addon: var(--charcoal);\n --rs-btn-default-hover-bg: var(--blue-yonder);\n --rs-iconbtn-activated-addon: var(--blue-yonder);\n --rs-btn-default-hover-text: var(--white);\n --rs-iconbtn-primary-activated-addon: var(--blue-yonder);\n --rs-btn-primary-active-bg: var(--blue-gray);\n --rs-iconbtn-primary-pressed-addon: var(--blue-gray);\n --rs-btn-ghost-active-text: var(--blue-gray);\n --rs-btn-subtle-text: var(--gunMetal);\n --rs-btn-subtle-hover-bg: transparent;\n --rs-btn-subtle-hover-text: var(--blue-yonder);\n --rs-btn-subtle-active-bg: transparent;\n --rs-btn-subtle-active-text: var(--blue-gray);\n\n /* Checkbox vars */\n --rs-checkbox-disabled-bg: var(--white);\n\n --rs-menuitem-active-text: var(--blue-gray);\n --rs-listbox-option-hover-bg: var(--blue-yonder-25);\n --rs-listbox-option-selected-bg: var(--blue-gray-25);\n /* tags */\n --rs-tag-bg: var(--gainsboro);\n\n /* toggle */\n --rs-toggle-checked-bg: var(--charcoal);\n --rs-toggle-checked-hover-bg: var(--gunMetal);\n}\n\nlabel {\n color: var(--slateGray);\n font-size: 13px;\n line-height: 18px;\n}\n\n.rs-picker-toggle-active,\n.rs-picker.rs-picker-focused {\n box-shadow: none;\n border: 1px solid var(--blue-gray) !important;\n border-radius: 0;\n}\n\n/* button */\n.rs-ripple-pond {\n height: 30px;\n}\n\n.rs-btn {\n line-height: 18px;\n padding-top: 6px;\n padding-bottom: 6px;\n border-radius: 0;\n}\n\n.rs-btn-sm {\n padding-top: 3px;\n padding-bottom: 3px;\n font-size: 15px;\n}\n\n.rs-btn-md {\n height: 30px;\n}\n\n.rs-btn-icon-with-text.rs-btn-md.rs-btn-icon-placement-left,\n.rs-btn-icon-with-text.rs-btn.rs-btn-icon-placement-left {\n padding-left: 32px;\n padding-top: 6px;\n padding-bottom: 6px;\n}\n\n.rs-btn-icon-with-text.rs-btn-sm.rs-btn-icon-placement-left {\n padding-top: 3px;\n padding-bottom: 3px;\n}\n\n.rs-btn-ghost:hover {\n background-color: transparent;\n}\n\n.rs-btn-ghost.rs-btn-active,\n.rs-btn-ghost:active {\n background-color: var(--blue-gray-25);\n border-color: var(--blue-gray);\n}\n\n.rs-btn-ghost.rs-btn-icon-with-text:hover > .rs-icon {\n background-color: transparent;\n}\n\n.rs-btn-icon-with-text:focus > .rs-icon,\n.rs-btn-icon-with-text:hover > .rs-icon {\n background-color: transparent;\n}\n\n.rs-btn-ghost.rs-btn,\n.rs-btn-ghost.rs-btn-md,\n.rs-btn-icon-with-text.rs-btn-md.rs-btn-icon-placement-left.rs-btn-ghost,\n.rs-btn-icon-with-text.rs-btn.rs-btn-icon-placement-left.rs-btn-ghost {\n padding-top: 5px;\n padding-bottom: 5px;\n}\n\n.rs-btn-ghost.rs-btn-sm,\n.rs-btn-icon-with-text.rs-btn-sm.rs-btn-icon-placement-left.rs-btn-ghost {\n padding-top: 2px;\n padding-bottom: 2px;\n}\n\n.rs-btn-icon.rs-btn,\n.rs-btn-icon.rs-btn-md {\n padding: 5px;\n}\n\n.rs-btn-subtle.rs-btn-icon.rs-btn-md {\n padding: 0;\n}\n\n.rs-btn-icon.rs-btn-sm {\n padding: 0px;\n}\n\n.rs-btn-icon.rs-btn-lg {\n padding: 7px;\n height: 40px;\n}\n\n.rs-btn-icon.rs-btn-ghost {\n padding: 4px;\n}\n\n.rs-btn-icon.rs-btn-lg.rs-btn-ghost {\n padding: 6px;\n}\n\n.rs-btn-icon-with-text.rs-btn-sm {\n padding-top: 5px;\n padding-bottom: 4px;\n line-height: 15px;\n font-size: 11px;\n}\n\n.rs-btn-icon.rs-btn > .rs-icon,\n.rs-btn-icon.rs-btn-md > .rs-icon {\n width: 20px;\n height: 20px;\n}\n\n.rs-btn-icon.rs-btn-lg > .rs-icon {\n width: 26px;\n height: 26px;\n}\n\n.rs-btn-icon.rs-btn-sm > .rs-icon {\n width: 14px;\n height: 14px;\n font-size: 14px;\n}\n\n.rs-btn-icon-with-text.rs-btn {\n line-height: 18px;\n}\n\n.rs-btn-icon-with-text.rs-btn > .rs-icon {\n width: 30px;\n height: 30px;\n padding: 5px;\n}\n\n.rs-btn-icon-with-text.rs-btn-sm > .rs-icon {\n width: 24px;\n height: 24px;\n padding: 4px;\n}\n\n.rs-btn-link,\n.rs-btn-link.rs-btn-md {\n font-size: 13px;\n text-decoration: underline;\n}\n\n.rs-btn-link.rs-btn-disabled,\n.rs-btn-link:disabled {\n text-decoration: underline;\n}\n\n.rs-btn-link.rs-btn-sm {\n font-size: 11px;\n}\n\n/* checkbox */\n.rs-checkbox-wrapper {\n top: 8px !important;\n}\n\n.rs-checkbox-checker {\n padding-bottom: 0;\n padding-left: 36px;\n}\n\n.rs-checkbox label {\n font-weight: 500;\n}\n\n.rs-checkbox-checker > label {\n font-size: 13px;\n color: var(--gunMetal);\n}\n\n.rs-checkbox-wrapper .rs-checkbox-inner::before {\n border: 2px solid var(--lightGray);\n background: var(--gainsboro) 0% 0% no-repeat padding-box;\n border-radius: 0px;\n}\n\n.rs-checkbox-wrapper .rs-checkbox-inner::after {\n border-color: var(--lightGray);\n border-width: 0 0 2px;\n -webkit-transform: rotate(0deg) scale(1);\n transform: rotate(0deg) scale(1);\n margin-top: -1px;\n}\n\n.rs-checkbox-indeterminate .rs-checkbox-wrapper .rs-checkbox-inner::before {\n background-color: var(--charcoal);\n border-color: var(--charcoal);\n}\n\n.rs-checkbox-indeterminate .rs-checkbox-wrapper .rs-checkbox-inner::after {\n border-color: var(--white);\n border-width: 0 0 2px;\n -webkit-transform: rotate(0deg) scale(1);\n transform: rotate(0deg) scale(1);\n margin-top: 0px;\n}\n\n.rs-checkbox-disabled:not(.rs-checkbox-checked):not(.rs-checkbox-indeterminate)\n .rs-checkbox-wrapper\n .rs-checkbox-inner:before {\n border-color: var(--lightGray);\n}\n\n.rs-checkbox-checked .rs-checkbox-wrapper .rs-checkbox-inner::before {\n border-color: var(--charcoal);\n background-color: var(--charcoal);\n}\n\nlabel:hover .rs-checkbox-wrapper .rs-checkbox-inner:before {\n border-color: var(--blue-yonder);\n background: var(--blue-yonder-25) 0% 0% no-repeat padding-box;\n}\n\n.rs-checkbox-checked label:hover .rs-checkbox-wrapper .rs-checkbox-inner:before {\n border-color: var(--blue-yonder);\n background: var(--blue-yonder) 0% 0% no-repeat padding-box;\n}\n\n.rs-checkbox-checked .rs-checkbox-wrapper .rs-checkbox-inner::after {\n border: solid var(--white);\n border-width: 0 2px 2px 0;\n}\n\n.checkbox-hidden > div > label > .rs-checkbox-wrapper {\n opacity: 0 !important;\n margin-left: -40px;\n position: inherit;\n}\n\n/* radio */\n\n.rs-radio-wrapper::before,\n.rs-radio-wrapper .rs-radio-inner::before,\n.rs-radio-wrapper {\n width: 14px;\n height: 14px;\n}\n\n.rs-radio-wrapper .rs-radio-inner::before {\n background: var(--gainsboro);\n border-width: 2px;\n}\n\n.rs-radio-checked .rs-radio-wrapper .rs-radio-inner::before {\n background: var(--gainsboro);\n border-color: var(--charcoal);\n}\n\n/* center of radio button when checked */\n.rs-radio-wrapper .rs-radio-inner::after {\n background: var(--charcoal);\n width: 6px;\n height: 6px;\n margin-top: 4px;\n margin-left: 4px;\n}\n\n.rs-radio.rs-radio-disabled .rs-radio-wrapper .rs-radio-inner::after {\n background: var(--lightGray);\n}\n\n.rs-radio.rs-radio-disabled .rs-radio-inner:before {\n background: var(--white);\n border-color: var(--lightGray);\n}\n\n.rs-radio-checker > label {\n color: var(--charcoal);\n font-weight: 500;\n line-height: 17px;\n}\n\n.rs-radio:hover .rs-radio-inner:before {\n border-color: var(--charcoal);\n}\n\n/* form */\n.rs-form:not(.rs-form-inline) .rs-form-group:not(:last-child) {\n margin-bottom: 32px;\n}\n\n/* Tags */\n\n.rs-tag-default {\n font-weight: 500;\n}\n\n.rs-tag-closable.rs-tag-md {\n padding-right: 32px;\n}\n\n.rs-tag-md {\n font-size: 13px;\n line-height: 18px;\n border-radius: 0px;\n padding-top: 1px;\n padding-bottom: 3px;\n}\n\n/* TagPicker */\n.rs-picker-tag .rs-tag {\n max-width: calc(100% - 30px) !important;\n background-color: var(--white);\n}\n\n.rs-tag-md .rs-tag-icon-close {\n padding: 6px 6px;\n}\n\n.rs-tag-icon-close.rs-btn-close {\n border-left: 1px solid var(--lightGray);\n}\n\n.rs-picker-tag .rs-picker-toggle.rs-btn-sm ~ .rs-picker-tag-wrapper .rs-tag {\n margin-top: 3px;\n}\n\n/* */\n.rs-modal-lg {\n width: 1300px;\n}\n\n.rs-slider-mark {\n font-size: 13px;\n color: var(--slateGray);\n}\n\n.rs-slider {\n position: absolute;\n width: 341px;\n margin-top: -19px;\n}\n\n.rs-slider-bar {\n height: 0;\n}\n\n.rs-slider-progress-bar {\n height: 2px;\n background: none;\n}\n\n.rs-slider-graduator > ul > li::before {\n visibility: hidden;\n}\n\n.rs-slider-graduator > ul > li:last-child::after,\n.rs-slider-graduator > ul > li::before {\n top: -3px;\n border: none;\n}\n\n.rs-slider-handle::before {\n background: var(--lightGray);\n border: unset;\n top: -6px;\n margin-left: -5px;\n width: 16px;\n height: 16px;\n}\n\n.rs-slider-graduator {\n margin-left: -5px;\n margin-top: -10px;\n}\n\n.rs-slider-graduated > div:nth-child(2)::before {\n background: #9095a2;\n z-index: 99;\n}\n\n.rs-slider-graduated > div:nth-child(2) {\n z-index: 9999;\n}\n\n.rs-slider-graduated > div:nth-child(3)::before {\n background: var(--charcoal);\n z-index: 99;\n}\n\n.rs-picker-menu {\n border-radius: 0;\n z-index: 9999 !important;\n}\n\n.rs-picker-default:not(.rs-picker-disabled) .rs-btn:hover,\n.rs-picker-default:not(.rs-picker-disabled) .rs-picker-toggle:hover,\n.rs-picker-default:not(.rs-picker-disabled) .rs-btn.active,\n.rs-picker-default:not(.rs-picker-disabled) .rs-picker-toggle.active {\n border-color: var(--slateGray) !important;\n}\n\n.rs-table:not(.rs-table-column-resizing) .rs-table-cell-header .rs-table-cell:hover ~ .rs-table-column-resize-spanner,\n.rs-table:not(.rs-table-column-resizing) .rs-table-column-resize-spanner:hover {\n background-color: var(--slateGray);\n}\n\n.rs-table-column-resize-spanner::before {\n border-color: transparent var(--slateGray) transparent transparent;\n}\n\n.rs-picker-toolbar-right-btn-ok {\n padding: 5px 10px;\n font-size: 13px;\n line-height: 1.42857143;\n border-radius: 2px;\n color: #fff;\n background-color: var(--charcoal);\n}\n\n.rs-picker-toolbar-right-btn-ok.rs-picker-toolbar-btn-disabled,\n.rs-picker-toolbar-right-btn-ok.rs-picker-toolbar-btn-disabled:hover,\n.rs-picker-toolbar-right-btn-ok.rs-picker-toolbar-btn-disabled:hover:active {\n background-color: var(--charcoal);\n}\n\n.rs-picker-toolbar-right-btn-ok:not(.rs-btn-disabled):hover {\n background-color: var(--charcoal);\n}\n\n.rs-modal-body {\n padding: 20px 25px 0 25px !important;\n}\n\n.rs-table-body-info {\n font-size: 13px;\n color: var(--slateGray);\n}\n\n.rs-modal-full .rs-modal-dialog {\n width: 100%;\n margin-left: 0;\n}\n\n.rs-modal-content {\n padding: 0;\n border-radius: 2px;\n}\n\n.rs-modal-body {\n padding: 20px 25px 20px 25px;\n margin-top: 0;\n max-height: 800px !important;\n min-height: 210px !important;\n}\n\n.rs-modal-header {\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n padding: 5px 14px 8px 14px;\n background: var(--charcoal);\n}\n\n.rs-modal-header .rs-modal-title {\n color: #f0f0f0;\n font-size: 22px;\n font-weight: normal;\n}\n\n.rs-table-cell-header,\n.rs-table-cell[role='columnheader'],\n.rs-table-cell-header:focus,\n.rs-table-cell[role='columnheader']:focus,\n.rs-table-cell-header:hover,\n.rs-table-cell[role='columnheader']:hover {\n background: var(--gainsboro);\n color: white;\n}\n\n.ghost .rs-picker-toggle.rs-btn.rs-btn-default {\n background-color: var(--white) !important;\n}\n\n.rs-table-hover .rs-table-row-header:hover .rs-table-cell-group,\n.rs-table-hover .rs-table-row-header:hover .rs-table-cell {\n background: var(--gainsboro);\n}\n\n.rs-table-cell[role='columnheader'] > .rs-table-cell-content {\n color: var(--slateGray);\n}\n\n.rs-table-cell {\n border: 1px solid #e0e0e0;\n}\n\n.rs-table-cell-content {\n font-size: 13px;\n font-weight: 500;\n color: var(--gunMetal);\n text-align: left;\n}\n\n.rs-table-cell-content > input {\n border: none;\n width: inherit;\n background: none;\n padding-left: 15px;\n font-size: 13px;\n font-weight: normal;\n color: var(--gunMetal);\n}\n\n.rs-table-scrollbar-handle,\n.rs-table-scrollbar-handle:hover,\n.rs-table-scrollbar-handle:focus {\n position: absolute;\n background-color: #575757;\n border-radius: 4px;\n}\n\n.rs-table-cell-content > .rs-checkbox {\n margin-top: -10px;\n margin-left: -10px;\n}\n\n.rs-modal-header-close {\n background: unset;\n right: 10px !important;\n top: 9px !important;\n font-size: 15px !important;\n color: var(--gainsboro) !important;\n}\n\n.rs-picker-tag-wrapper {\n padding-bottom: 0;\n}\n\n.rs-picker-input {\n border-radius: 0;\n vertical-align: top;\n}\n\n.rs-picker-toggle-placeholder {\n font-size: 11px;\n color: var(--slateGray) !important;\n}\n\n.rs-picker-has-value .rs-btn .rs-picker-toggle-value,\n.rs-picker-has-value .rs-picker-toggle .rs-picker-toggle-value {\n color: var(--gunMetal);\n font-size: 13px;\n font-weight: normal;\n}\n\n.rs-picker-select-menu-item.rs-picker-select-menu-item-active,\n.rs-picker-select-menu-item.rs-picker-select-menu-item-active:hover,\n.rs-picker-select-menu-item:not(.rs-picker-select-menu-item-disabled):hover,\n.rs-picker-select-menu-item.rs-picker-select-menu-item-focus,\n.rs-picker-select-menu-item {\n color: var(--slateGray);\n font-size: 13px;\n font-weight: normal;\n}\n\n.rs-picker-select-menu-item {\n padding: 4px 12px;\n}\n\n.grouped .rs-picker-select-menu-item {\n padding-left: 0px;\n}\n\n.rs-picker-select-menu-items {\n margin-bottom: 0;\n}\n\n.rs-picker-select-menu-items.rs-picker-select-menu-group.rs-picker-select-menu-group-title {\n font-size: 13px;\n color: var(--slateGray);\n}\n\n.rs-picker-toggle-clean,\n.rs-picker-toggle-caret {\n color: var(--slateGray);\n}\n\n.rs-picker-check-menu-group[role='listitem'] {\n height: 48px !important;\n}\n\n.rs-picker-check-menu-items .rs-picker-check-menu-group:not(:first-child) {\n padding-top: 0px !important;\n}\n\n.rs-picker-check-menu.rs-picker-check-menu-items {\n max-height: 200px !important;\n}\n\n.rs-table-cell-header .rs-table-cell-content {\n padding: 10px 7px;\n}\n\n.rs-table-cell-header-icon-sort {\n color: var(--slateGray);\n line-height: 1.66666667;\n position: absolute;\n right: 9px;\n top: 10px;\n}\n\n.rs-table-cell-header-icon-sort-asc::after {\n color: var(--slateGray);\n}\n\n.rs-table-cell-header-icon-sort-desc::after {\n color: var(--slateGray);\n}\n\n.rs-table-hover .rs-table-row:not(.rs-table-row-header):hover,\n.rs-table-hover .rs-table-row:hover .rs-table-cell-group,\n.rs-table-hover .rs-table-row:hover .rs-table-cell {\n background: var(--blue-yonder-25) !important;\n}\n\n.rs-table-cell,\n.rs-table-cell-group,\n.rs-table-row {\n -webkit-transition: background-color 0.1s linear !important;\n transition: background-color 0.1s linear !important;\n}\n\n.rs-table-row-expanded {\n height: 100px !important;\n background: white !important;\n}\n\n.rs-plaintext {\n font-size: 13px !important;\n}\n"],sourceRoot:""}]);const __WEBPACK_DEFAULT_EXPORT__=___CSS_LOADER_EXPORT___},"./stories lazy recursive ^\\.\\/.*$ include: (?:\\/stories(?:\\/(?%21\\.)(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/%7C\\/%7C$)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$":(module,__unused_webpack_exports,__webpack_require__)=>{var map={"./Colors.stories":["./stories/Colors.stories.tsx",506],"./Colors.stories.tsx":["./stories/Colors.stories.tsx",506],"./Icon.stories":["./stories/Icon.stories.tsx",3674],"./Icon.stories.tsx":["./stories/Icon.stories.tsx",3674],"./components/Dialog.stories":["./stories/components/Dialog.stories.tsx",3709],"./components/Dialog.stories.tsx":["./stories/components/Dialog.stories.tsx",3709],"./components/Dropdown.stories":["./stories/components/Dropdown.stories.tsx",2139],"./components/Dropdown.stories.tsx":["./stories/components/Dropdown.stories.tsx",2139],"./components/MapMenuModal.stories":["./stories/components/MapMenuModal.stories.tsx",8696],"./components/MapMenuModal.stories.tsx":["./stories/components/MapMenuModal.stories.tsx",8696],"./components/Message.stories":["./stories/components/Message.stories.tsx",4672],"./components/Message.stories.tsx":["./stories/components/Message.stories.tsx",4672],"./components/Notifier.stories":["./stories/components/Notifier.stories.tsx",489],"./components/Notifier.stories.tsx":["./stories/components/Notifier.stories.tsx",489],"./components/SideMenu.stories":["./stories/components/SideMenu.stories.tsx",920],"./components/SideMenu.stories.tsx":["./stories/components/SideMenu.stories.tsx",920],"./elements/Button.stories":["./stories/elements/Button.stories.tsx",9929],"./elements/Button.stories.tsx":["./stories/elements/Button.stories.tsx",9929],"./elements/Field.stories":["./stories/elements/Field.stories.tsx",8392],"./elements/Field.stories.tsx":["./stories/elements/Field.stories.tsx",8392],"./elements/Fieldset.stories":["./stories/elements/Fieldset.stories.tsx",6330],"./elements/Fieldset.stories.tsx":["./stories/elements/Fieldset.stories.tsx",6330],"./elements/IconButton.stories":["./stories/elements/IconButton.stories.tsx",3856],"./elements/IconButton.stories.tsx":["./stories/elements/IconButton.stories.tsx",3856],"./elements/Label.stories":["./stories/elements/Label.stories.tsx",868],"./elements/Label.stories.tsx":["./stories/elements/Label.stories.tsx",868],"./elements/Legend.stories":["./stories/elements/Legend.stories.tsx",1627],"./elements/Legend.stories.tsx":["./stories/elements/Legend.stories.tsx",1627],"./elements/SingleTag.stories":["./stories/elements/SingleTag.stories.tsx",5138],"./elements/SingleTag.stories.tsx":["./stories/elements/SingleTag.stories.tsx",5138],"./elements/Tag.stories":["./stories/elements/Tag.stories.tsx",2377],"./elements/Tag.stories.tsx":["./stories/elements/Tag.stories.tsx",2377],"./elements/TagGroup.stories":["./stories/elements/TagGroup.stories.tsx",2245],"./elements/TagGroup.stories.tsx":["./stories/elements/TagGroup.stories.tsx",2245],"./fields/CheckPicker/CheckPicker.stories":["./stories/fields/CheckPicker/CheckPicker.stories.tsx",748],"./fields/CheckPicker/CheckPicker.stories.tsx":["./stories/fields/CheckPicker/CheckPicker.stories.tsx",748],"./fields/CheckPicker/CheckPickerWithCustomSearch.stories":["./stories/fields/CheckPicker/CheckPickerWithCustomSearch.stories.tsx",4680,4337],"./fields/CheckPicker/CheckPickerWithCustomSearch.stories.tsx":["./stories/fields/CheckPicker/CheckPickerWithCustomSearch.stories.tsx",4680,4337],"./fields/Checkbox.stories":["./stories/fields/Checkbox.stories.tsx",4482],"./fields/Checkbox.stories.tsx":["./stories/fields/Checkbox.stories.tsx",4482],"./fields/CoordinatesInput.stories":["./stories/fields/CoordinatesInput.stories.tsx",7249],"./fields/CoordinatesInput.stories.tsx":["./stories/fields/CoordinatesInput.stories.tsx",7249],"./fields/DatePicker.stories":["./stories/fields/DatePicker.stories.tsx",4012],"./fields/DatePicker.stories.tsx":["./stories/fields/DatePicker.stories.tsx",4012],"./fields/DateRangePicker.stories":["./stories/fields/DateRangePicker.stories.tsx",1765],"./fields/DateRangePicker.stories.tsx":["./stories/fields/DateRangePicker.stories.tsx",1765],"./fields/MultiCheckbox.stories":["./stories/fields/MultiCheckbox.stories.tsx",355],"./fields/MultiCheckbox.stories.tsx":["./stories/fields/MultiCheckbox.stories.tsx",355],"./fields/MultiRadio.stories":["./stories/fields/MultiRadio.stories.tsx",1049],"./fields/MultiRadio.stories.tsx":["./stories/fields/MultiRadio.stories.tsx",1049],"./fields/MultiSelect/MultiSelect.stories":["./stories/fields/MultiSelect/MultiSelect.stories.tsx",6506],"./fields/MultiSelect/MultiSelect.stories.tsx":["./stories/fields/MultiSelect/MultiSelect.stories.tsx",6506],"./fields/MultiSelect/MultiSelectWithCustomSearch.stories":["./stories/fields/MultiSelect/MultiSelectWithCustomSearch.stories.tsx",4680,231],"./fields/MultiSelect/MultiSelectWithCustomSearch.stories.tsx":["./stories/fields/MultiSelect/MultiSelectWithCustomSearch.stories.tsx",4680,231],"./fields/MultiZoneEditor.stories":["./stories/fields/MultiZoneEditor.stories.tsx",1356],"./fields/MultiZoneEditor.stories.tsx":["./stories/fields/MultiZoneEditor.stories.tsx",1356],"./fields/NumberInput.stories":["./stories/fields/NumberInput.stories.tsx",8851],"./fields/NumberInput.stories.tsx":["./stories/fields/NumberInput.stories.tsx",8851],"./fields/Search/WithCustomSearch.stories":["./stories/fields/Search/WithCustomSearch.stories.tsx",4680,5453],"./fields/Search/WithCustomSearch.stories.tsx":["./stories/fields/Search/WithCustomSearch.stories.tsx",4680,5453],"./fields/Search/WithOptions.stories":["./stories/fields/Search/WithOptions.stories.tsx",5590],"./fields/Search/WithOptions.stories.tsx":["./stories/fields/Search/WithOptions.stories.tsx",5590],"./fields/Search/WithOptionsAndCustomMenuItem.stories":["./stories/fields/Search/WithOptionsAndCustomMenuItem.stories.tsx",2205],"./fields/Search/WithOptionsAndCustomMenuItem.stories.tsx":["./stories/fields/Search/WithOptionsAndCustomMenuItem.stories.tsx",2205],"./fields/Search/WithQuery.stories":["./stories/fields/Search/WithQuery.stories.tsx",7151,3618],"./fields/Search/WithQuery.stories.tsx":["./stories/fields/Search/WithQuery.stories.tsx",7151,3618],"./fields/Select/Select.stories":["./stories/fields/Select/Select.stories.tsx",9540],"./fields/Select/Select.stories.tsx":["./stories/fields/Select/Select.stories.tsx",9540],"./fields/Select/SelectWithCustomSearch.stories":["./stories/fields/Select/SelectWithCustomSearch.stories.tsx",4680,9651],"./fields/Select/SelectWithCustomSearch.stories.tsx":["./stories/fields/Select/SelectWithCustomSearch.stories.tsx",4680,9651],"./fields/TextInput.stories":["./stories/fields/TextInput.stories.tsx",6600],"./fields/TextInput.stories.tsx":["./stories/fields/TextInput.stories.tsx",6600],"./fields/Textarea.stories":["./stories/fields/Textarea.stories.tsx",7754],"./fields/Textarea.stories.tsx":["./stories/fields/Textarea.stories.tsx",7754],"./formiks/AutoComplete/WithOptions.stories":["./stories/formiks/AutoComplete/WithOptions.stories.tsx",3340],"./formiks/AutoComplete/WithOptions.stories.tsx":["./stories/formiks/AutoComplete/WithOptions.stories.tsx",3340],"./formiks/AutoComplete/WithQuery.stories":["./stories/formiks/AutoComplete/WithQuery.stories.tsx",7151,4693],"./formiks/AutoComplete/WithQuery.stories.tsx":["./stories/formiks/AutoComplete/WithQuery.stories.tsx",7151,4693],"./formiks/FormikCheckbox.stories":["./stories/formiks/FormikCheckbox.stories.tsx",270],"./formiks/FormikCheckbox.stories.tsx":["./stories/formiks/FormikCheckbox.stories.tsx",270],"./formiks/FormikCoordinatesInput.stories":["./stories/formiks/FormikCoordinatesInput.stories.tsx",7386],"./formiks/FormikCoordinatesInput.stories.tsx":["./stories/formiks/FormikCoordinatesInput.stories.tsx",7386],"./formiks/FormikDatePicker.stories":["./stories/formiks/FormikDatePicker.stories.tsx",4442],"./formiks/FormikDatePicker.stories.tsx":["./stories/formiks/FormikDatePicker.stories.tsx",4442],"./formiks/FormikDateRangePicker.stories":["./stories/formiks/FormikDateRangePicker.stories.tsx",1936],"./formiks/FormikDateRangePicker.stories.tsx":["./stories/formiks/FormikDateRangePicker.stories.tsx",1936],"./formiks/FormikEffect.stories":["./stories/formiks/FormikEffect.stories.tsx",3397],"./formiks/FormikEffect.stories.tsx":["./stories/formiks/FormikEffect.stories.tsx",3397],"./formiks/FormikMultiCheckbox.stories":["./stories/formiks/FormikMultiCheckbox.stories.tsx",534],"./formiks/FormikMultiCheckbox.stories.tsx":["./stories/formiks/FormikMultiCheckbox.stories.tsx",534],"./formiks/FormikMultiRadio.stories":["./stories/formiks/FormikMultiRadio.stories.tsx",6337],"./formiks/FormikMultiRadio.stories.tsx":["./stories/formiks/FormikMultiRadio.stories.tsx",6337],"./formiks/FormikMultiSelect.stories":["./stories/formiks/FormikMultiSelect.stories.tsx",301],"./formiks/FormikMultiSelect.stories.tsx":["./stories/formiks/FormikMultiSelect.stories.tsx",301],"./formiks/FormikNumberInput.stories":["./stories/formiks/FormikNumberInput.stories.tsx",6589],"./formiks/FormikNumberInput.stories.tsx":["./stories/formiks/FormikNumberInput.stories.tsx",6589],"./formiks/FormikSelect.stories":["./stories/formiks/FormikSelect.stories.tsx",1581],"./formiks/FormikSelect.stories.tsx":["./stories/formiks/FormikSelect.stories.tsx",1581],"./formiks/FormikTextInput.stories":["./stories/formiks/FormikTextInput.stories.tsx",6159],"./formiks/FormikTextInput.stories.tsx":["./stories/formiks/FormikTextInput.stories.tsx",6159],"./formiks/FormikTextarea.stories":["./stories/formiks/FormikTextarea.stories.tsx",6310,4167],"./formiks/FormikTextarea.stories.tsx":["./stories/formiks/FormikTextarea.stories.tsx",6310,4167],"./symbols/ExclamationPoint.stories":["./stories/symbols/ExclamationPoint.stories.tsx",4539],"./symbols/ExclamationPoint.stories.tsx":["./stories/symbols/ExclamationPoint.stories.tsx",4539],"./tables/DataTable.stories":["./stories/tables/DataTable.stories.tsx",3897],"./tables/DataTable.stories.tsx":["./stories/tables/DataTable.stories.tsx",3897],"./tables/SimpleTable.stories":["./stories/tables/SimpleTable.stories.tsx",6750,5016],"./tables/SimpleTable.stories.tsx":["./stories/tables/SimpleTable.stories.tsx",6750,5016],"./tables/TableWithSelectableRows.stories":["./stories/tables/TableWithSelectableRows.stories.tsx",6750,2293],"./tables/TableWithSelectableRows.stories.tsx":["./stories/tables/TableWithSelectableRows.stories.tsx",6750,2293],"./tests/button.stories":["./stories/tests/button.stories.tsx",5189],"./tests/button.stories.tsx":["./stories/tests/button.stories.tsx",5189]};function webpackAsyncContext(req){if(!__webpack_require__.o(map,req))return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}));var ids=map[req],id=ids[0];return Promise.all(ids.slice(1).map(__webpack_require__.e)).then((()=>__webpack_require__(id)))}webpackAsyncContext.keys=()=>Object.keys(map),webpackAsyncContext.id="./stories lazy recursive ^\\.\\/.*$ include: (?:\\/stories(?:\\/(?%21\\.)(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/%7C\\/%7C$)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$",module.exports=webpackAsyncContext},"./stories lazy recursive ^\\.\\/.*$ include: (?:\\/stories(?:\\/(?%21\\.)(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/%7C\\/%7C$)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./stories lazy recursive ^\\.\\/.*$ include: (?:\\/stories(?:\\/(?%21\\.)(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/%7C\\/%7C$)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$",module.exports=webpackEmptyAsyncContext},"./storybook-config-entry.js":(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var dist=__webpack_require__("./node_modules/@storybook/global/dist/index.mjs"),external_STORYBOOK_MODULE_PREVIEW_API_=__webpack_require__("@storybook/preview-api");const external_STORYBOOK_MODULE_CHANNEL_POSTMESSAGE_namespaceObject=__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__,external_STORYBOOK_MODULE_CHANNEL_WEBSOCKET_namespaceObject=__STORYBOOK_MODULE_CHANNEL_WEBSOCKET__,importers=[async path=>{if(!/^\.[\\/](?:stories(?:\/(?!\.)(?:(?:(?!(?:^|\/)\.).)*?)\/|\/|$)(?!\.)(?=.)[^/]*?\.stories\.mdx)$/.exec(path))return;const pathRemainder=path.substring(10);return __webpack_require__("./stories lazy recursive ^\\.\\/.*$ include: (?:\\/stories(?:\\/(?%21\\.)(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/%7C\\/%7C$)(?%21\\.)(?=.)[^/]*?\\.stories\\.mdx)$")("./"+pathRemainder)},async path=>{if(!/^\.[\\/](?:stories(?:\/(?!\.)(?:(?:(?!(?:^|\/)\.).)*?)\/|\/|$)(?!\.)(?=.)[^/]*?\.stories\.(js|jsx|ts|tsx))$/.exec(path))return;const pathRemainder=path.substring(10);return __webpack_require__("./stories lazy recursive ^\\.\\/.*$ include: (?:\\/stories(?:\\/(?%21\\.)(?:(?:(?%21(?:^%7C\\/)\\.).)*?)\\/%7C\\/%7C$)(?%21\\.)(?=.)[^/]*?\\.stories\\.(js%7Cjsx%7Cts%7Ctsx))$")("./"+pathRemainder)}];const channel=(0,external_STORYBOOK_MODULE_CHANNEL_POSTMESSAGE_namespaceObject.createChannel)({page:"preview"});if(external_STORYBOOK_MODULE_PREVIEW_API_.addons.setChannel(channel),"DEVELOPMENT"===dist.global.CONFIG_TYPE){const serverChannel=(0,external_STORYBOOK_MODULE_CHANNEL_WEBSOCKET_namespaceObject.createChannel)({});external_STORYBOOK_MODULE_PREVIEW_API_.addons.setServerChannel(serverChannel),window.__STORYBOOK_SERVER_CHANNEL__=serverChannel}const preview=new external_STORYBOOK_MODULE_PREVIEW_API_.PreviewWeb;window.__STORYBOOK_PREVIEW__=preview,window.__STORYBOOK_STORY_STORE__=preview.storyStore,window.__STORYBOOK_ADDONS_CHANNEL__=channel,window.__STORYBOOK_CLIENT_API__=new external_STORYBOOK_MODULE_PREVIEW_API_.ClientApi({storyStore:preview.storyStore}),preview.initialize({importFn:async function importFn(path){for(let i=0;iimporters[i](path),x());if(moduleExports)return moduleExports}var x},getProjectAnnotations:()=>(0,external_STORYBOOK_MODULE_PREVIEW_API_.composeConfigs)([__webpack_require__("./node_modules/@storybook/react-webpack5/node_modules/@storybook/react/preview.js"),__webpack_require__("./node_modules/@storybook/addon-essentials/dist/docs/preview.mjs"),__webpack_require__("./node_modules/@storybook/addon-essentials/dist/actions/preview.mjs"),__webpack_require__("./node_modules/@storybook/addon-essentials/dist/backgrounds/preview.mjs"),__webpack_require__("./node_modules/@storybook/addon-essentials/dist/measure/preview.mjs"),__webpack_require__("./node_modules/@storybook/addon-essentials/dist/outline/preview.mjs"),__webpack_require__("./node_modules/@storybook/addon-essentials/dist/highlight/preview.mjs"),__webpack_require__("./node_modules/@storybook/addon-a11y/dist/preview.mjs"),__webpack_require__("./.storybook/preview.tsx")])})},"@storybook/channels":module=>{"use strict";module.exports=__STORYBOOK_MODULE_CHANNELS__},"@storybook/client-logger":module=>{"use strict";module.exports=__STORYBOOK_MODULE_CLIENT_LOGGER__},"@storybook/core-events":module=>{"use strict";module.exports=__STORYBOOK_MODULE_CORE_EVENTS__},"@storybook/preview-api":module=>{"use strict";module.exports=__STORYBOOK_MODULE_PREVIEW_API__}},__webpack_require__=>{__webpack_require__.O(0,[7268],(()=>{return moduleId="./storybook-config-entry.js",__webpack_require__(__webpack_require__.s=moduleId);var moduleId}));__webpack_require__.O()}]); -//# sourceMappingURL=main.44e1b471.iframe.bundle.js.map \ No newline at end of file +//# sourceMappingURL=main.308d18dd.iframe.bundle.js.map \ No newline at end of file diff --git a/main.308d18dd.iframe.bundle.js.map b/main.308d18dd.iframe.bundle.js.map new file mode 100644 index 000000000..a773e18d4 --- /dev/null +++ b/main.308d18dd.iframe.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.308d18dd.iframe.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;AAkCA;AC7BA;AACA;;;;;;AAQA;;AAEA;;;;;AAOA;AAGA;;;;;;;AASA;;;;AAMA;AACA;AAiBA;;AAGA;AAZA;;;;;;;AAcA;;;ACoCA;;;AAGA;AACA;;;;;;AAQA;;;;;;;AASA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;AAKA;AACA;AACA;;AAIA;;AAEA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;;AAMA;AACA;;AAIA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;;ACrGA;;AAEA;;;;;;;;;;;;;;;;;;;;AAwBA;;AAIA;AACA;;;;;AAKA;AACA;;;;;;AAMA;AACA;;;;;;AAMA;AACA;;;;ACpIA;;;;AAIA;AACA;;;;;ACCA;;;;;;AAMA;;;;;;AAMA;;;;;;AAMA;;;;;;;AAOA;;;;;;;AAOA;;;;;;;AAOA;;;;;;AAMA;;;;;;;;;;AC5DA;;;ACeA;;;;;;AAMA;;;;;;AAMA;;;;;;AAMA;;;;;;;AAOA;;;;;;;AAOA;;;;;;;AAOA;;;;;;AAMA;;;;;;;;AD5DA;AEJA;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;AAaA;;;;;;;;;ACRA;AACA;;;ACmBA;;;;;;;;;;AAYA;AAGA;;;;AAIA;;;;AAMA;;;;;AAOA;;;;;;;AASA;ACtCA;AACA;;;;;AAKA;AACA;AACA;;;;;AAMA;;;;;AAOA;;;;;;;;;;;;ACfA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;;;AAIA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;AAMA;;;;;;AAMA;;;;;;;;;;;;;AAeA;;ACzFA;;AAEA;AACA;;;;;;AAMA;;;AAGA;;;;AAIA;;;;;;;ACvBA;;;;;;;;;;;AAaA;;;;ACsBA;AACA;AACA;;;;;;;AASA;AACA;;;;;;AAMA;;;;;AAKA;;;;;AAKA;;AAIA;AACA;AACA;AAGA;AACA;AACA;;;;AAIA;AACA;;;;;AAKA;AACA;;;;;AAKA;AACA;;;AC/FA;;AAEA;;;;;;;;;;;;;;;ACuBA;AAIA;AACA;;;;;AAOA;;;;;;;AClCA;AAGA;;;;;;;;;;;;ACiCA;AAKA;AACA;;;AAGA;AAGA;;;AClDA;AACA;;;;;;ACCA;AAGA;;;;;ACkFA;;AAEA;AAOA;;AAEA;;;AAGA;;;;;;;;;;;AAWA;;AAIA;AAGA;AACA;AAIA;AAGA;AACA;AAGA;AAGA;AACA;;;;;;;;;ACqEA;;;AAKA;;AAIA;;;AAGA;;;AAKA;;;;;AAOA;;AAEA;;;;;;;;;;;;;;;;AAkBA;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjLA;;;;;;;ACwFA;;;;;;AAMA;AACA;;;;;;;;;AASA;;;;;AAKA;;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChIA;;;;;;;;;;;;;;;;;;AAkBA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;;;AAOA;;;AAGA;;;;;;AAMA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;AAeA;AACA;;;;;AAKA;;;;AAIA;;;AAGA;;;;;;;;;;AAUA;;;AAGA;;;;;;;AAOA;;;;;;;;;AASA;AACA;;;AAGA;AACA;;;;;;;;;ACdA;;;;;;AAMA;;;AAGA;;;;AC0BA;AACA;AAIA;;;;AAIA;;;;AAIA;AAKA;;;;;;;ACxJA;AACA;;;;;;;;AAQA;;;;;;;;;;;;;;AAcA;;;AAGA;;AAIA;AAGA;AACA;;;;;;AAMA;;;;;;;;;ACkGA;AACA;AAIA;;;AAGA;;;;;AAKA;AAKA;;AAIA;;;;;;;;;;;;;;AC4GA;;;AAGA;;;AAGA;;AAIA;AACA;;;;AAMA;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;AC1QA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;AAIA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;;;AAOA;;;AAGA;;;;;;AAMA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;AAeA;AACA;;;;;AAKA;;;;AAIA;;;AAGA;;;;;;;;;;AAUA;;;AAGA;;;;;;;AAOA;;;;;;;;;AASA;AACA;;;AAGA;AACA;;;;;;;;;;;;;ACiSA;;;AAGA;;;AAGA;;AAIA;AACA;;;;AAMA;;AAKA;;AC5dA;;AAEA;;;;;;;AAOA;;AAIA;;;;AAIA;;;;;;;;AAUA;;;;;;;;;;;;;ACkFA;;AAEA;;;;;AAcA;;;;;AAKA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxKA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;AAQA;;;;;;AAQA;;;;;;;;;;;;AAcA;;;AAGA;;;;;AAKA;;;;;;;;;;;;;ACaA;AAGA;;;;;;;AASA;;;;;;;;;;AClEA;AACA;;;;;;;;;;AAUA;;;;;AAKA;;;;;;ACzBA;;AAEA;AAGA;;;AAKA;;;;;ACDA;AAGA;AACA;;AAIA;;;;;ACtEA;AAGA;;;;;ACiCA;AACA;AACA;;;;;;ACyHA;;;AAKA;;;;;;;;;AAWA;;;;;;AAMA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;AACA;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;AC5LA;AACA;;;;;;AAMA;;;;AAIA;;;;;AAKA;;;;;;;;ACmCA;AAGA;AACA;;;;;AAOA;AAMA;AACA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;AAKA;;;AAKA;;;;;;AAQA;;;;;;;ACxLA;;;;;;AAMA;;AAIA;;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAiCA;;;AArBA;;;;AAIA;;AAmBA;;;AAZA;AACA;AACA;AACA;;;;;AAaA;;;;;AClEA;;;ACCA;;;;ACAA;;AAEA;;AAIA;;;AAIA;AACA;AACA;AACA;;;AAGA;AA2BA;;AAtBA;;;AAIA;;;AAoBA;AAbA;AACA;AAEA;;;AAIA;AACA;AAUA","sources":["webpack://@mtes-mct/monitor-ui__root/./.storybook/components/GlobalDecorator.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/MapMenuDialog/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Button.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/IconButton.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/IconBox.tsx","webpack://@mtes-mct/monitor-ui__root/./src/GlobalStyle.ts","webpack://@mtes-mct/monitor-ui__root/./src/theme.ts","webpack://@mtes-mct/monitor-ui__root/./src/OnlyFontGlobalStyle.ts","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/Action.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/Body.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/Title.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dropdown/Item.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dropdown/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/SideMenu/Button.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/SideMenu/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/SingleTag.tsx","webpack://@mtes-mct/monitor-ui__root/./src/symbols/ExclamationPoint.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Message.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Legend.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Fieldset.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/FieldError.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Label.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Tag/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Search.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Checkbox.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CheckPicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DatePicker/CalendarPicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/NumberInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/DateInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/RangedTimePicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/TimeInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DatePicker/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/RangeCalendarPicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiCheckbox.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiSelect.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiRadio.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiZoneEditor/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/NumberInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/DDCoordinatesInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/DMDCoordinatesInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/DMSCoordinatesInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Select.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Textarea.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/TextInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/tables/SimpleTable.tsx","webpack://@mtes-mct/monitor-ui__root/./src/tables/DataTable/SortingIcon.ts","webpack://@mtes-mct/monitor-ui__root/./src/tables/DataTable/Th.tsx","webpack://@mtes-mct/monitor-ui__root/./src/tables/TableWithSelectableRows/index.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { CustomProvider as RsuiteCustomProvider } from 'rsuite'\nimport rsuiteFrFr from 'rsuite/locales/fr_FR'\nimport { createGlobalStyle, ThemeProvider } from 'styled-components'\n\nimport { GlobalStyle, THEME } from '../../src'\n\nimport type { StoryFn } from '@storybook/react'\n\nconst UntypedGlobalStyle = GlobalStyle as any\nconst UntypedThemeProvider = ThemeProvider as any\n\nconst CustomGlobalStyle: any = createGlobalStyle`\n html,\n body.sb-show-main.sb-main-padded {\n height: 100%;\n padding: 0;\n width: 640px;\n }\n\n code {\n background-color: #1e1e1e;\n color: #ffffff;\n font-size: 12px;\n padding: 2px 6px;\n vertical-align: 1px;\n }\n\n #root {\n height: 100%;\n width: 100%;\n }\n`\n\nexport function GlobalDecorator(Story: StoryFn) {\n return (\n \n \n \n )\n}\n\nexport function GlobalDecoratorWrapper({ children }) {\n return (\n \n \n \n \n\n {children}\n \n \n )\n}\n","import styled from 'styled-components'\n\nimport { IconButton } from '../../elements/IconButton'\n\nconst Container = styled.div`\n background-color: ${p => p.theme.color.white};\n box-shadow: 0px 3px 6px ${p => p.theme.color.slateGray};\n display: flex;\n flex-direction: column;\n margin-right: 6px;\n max-height: 520px;\n width: 320px;\n`\n\nconst Header = styled.div`\n align-items: center;\n background-color: ${p => p.theme.color.charcoal};\n display: flex;\n height: 40px;\n justify-content: space-between;\n padding: 9px 4px 9px 10px;\n`\n\nconst Title = styled.span.attrs(props => ({\n title: props.title ?? String(props.children)\n}))`\n color: ${p => p.theme.color.white};\n font-size: 16px;\n line-height: 22px;\n margin-right: 6px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n`\n\nconst Body = styled.div`\n height: calc(100% - 40px);\n overflow-y: auto;\n padding: 12px;\n`\n\nconst VisibilityButton = styled(IconButton as any)`\n background-color: ${p => p.theme.color.gainsboro};\n`\n\nconst CloseButton = styled(IconButton as any)`\n color: white;\n`\n\nconst Footer = styled.div`\n background: ${p => p.theme.color.white};\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 12px;\n width: 100%;\n z-index: 10;\n`\n\nexport const MapMenuDialog = {\n Body,\n CloseButton,\n Container,\n Footer,\n Header,\n Title,\n VisibilityButton\n}\n","import classnames from 'classnames'\nimport { useCallback, useMemo, type MouseEvent, type ButtonHTMLAttributes, type FunctionComponent } from 'react'\nimport styled from 'styled-components'\n\nimport { Accent, Size } from '../constants'\nimport { type IconProps } from '../types'\nimport { stopMouseEventPropagation } from '../utils/stopMouseEventPropagation'\n\nconst ICON_SIZE: Record = {\n [Size.LARGE]: 20,\n [Size.NORMAL]: 20,\n [Size.SMALL]: 12\n}\n\nexport type ButtonProps = Omit, 'children'> & {\n Icon?: FunctionComponent | undefined\n accent?: Accent | undefined\n children?: string | undefined\n isFullWidth?: boolean | undefined\n size?: Size | undefined\n /** Prevent onClick event propagation. */\n withUnpropagatedClick?: boolean | undefined\n}\nexport function Button({\n accent = Accent.PRIMARY,\n children,\n className,\n Icon,\n isFullWidth = false,\n onClick,\n size = Size.NORMAL,\n type = 'button',\n withUnpropagatedClick = false,\n ...nativeProps\n}: ButtonProps) {\n const handleClick = useCallback(\n (event: MouseEvent) => {\n if (withUnpropagatedClick) {\n stopMouseEventPropagation(event)\n }\n\n if (onClick) {\n onClick(event)\n }\n },\n [onClick, withUnpropagatedClick]\n )\n\n const commonChildren = useMemo(\n () => (\n <>\n {Icon && }\n {children && {children}}\n \n ),\n [children, Icon, size]\n )\n\n const commonProps = useMemo(\n () => ({\n as: StyledButton,\n children: commonChildren,\n className: classnames('Element-Button', className),\n isFullWidth,\n onClick: handleClick,\n size,\n type,\n ...nativeProps\n }),\n [className, commonChildren, handleClick, isFullWidth, nativeProps, size, type]\n )\n\n switch (accent) {\n case Accent.SECONDARY:\n return \n\n case Accent.TERTIARY:\n return \n\n default:\n return \n }\n}\n\nconst FONT_SIZE: Record = {\n [Size.LARGE]: '13px',\n [Size.NORMAL]: '13px',\n [Size.SMALL]: '11px'\n}\nconst PADDING: Record = {\n [Size.LARGE]: '12px',\n [Size.NORMAL]: '6px 12px',\n [Size.SMALL]: '5px 8px 4px'\n}\nconst StyledButton = styled.button<{\n isFullWidth: boolean\n size: Size\n}>`\n align-items: center;\n display: inline-flex;\n font-size: ${p => FONT_SIZE[p.size]};\n justify-content: center;\n max-width: 100%;\n padding: ${p => PADDING[p.size]};\n width: ${p => (p.isFullWidth ? '100%' : 'auto')};\n\n /* SVG Icon Components are wrapped within a
*/\n > div {\n margin-right: 5px;\n }\n`\n\nconst ButtonLabel = styled.span`\n line-height: 1.3846;\n margin-top: -3px;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`\n\nexport const PrimaryButton = styled.button`\n background-color: ${p => p.theme.color.charcoal};\n border: 1px solid ${p => p.theme.color.charcoal};\n color: ${p => p.theme.color.gainsboro};\n\n :hover,\n &._hover {\n background-color: ${p => p.theme.color.blueYonder};\n border: 1px solid ${p => p.theme.color.blueYonder};\n color: ${p => p.theme.color.white};\n }\n\n :active,\n &._active {\n background-color: ${p => p.theme.color.blueGray};\n border: 1px solid ${p => p.theme.color.blueGray};\n color: ${p => p.theme.color.white};\n }\n\n :disabled,\n &._disabled {\n background-color: ${p => p.theme.color.lightGray};\n border: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.cultured};\n }\n`\n\nexport const SecondaryButton = styled.button`\n background-color: transparent;\n border: 1px solid ${p => p.theme.color.charcoal};\n color: ${p => p.theme.color.charcoal};\n\n :hover,\n &._hover {\n background-color: ${p => p.theme.color.blueYonder25};\n border: 1px solid ${p => p.theme.color.blueYonder};\n color: ${p => p.theme.color.blueYonder};\n }\n\n :active,\n &._active {\n background-color: ${p => p.theme.color.blueGray25};\n border: 1px solid ${p => p.theme.color.blueGray};\n color: ${p => p.theme.color.blueGray};\n }\n\n :disabled,\n &._disabled {\n background-color: transparent;\n border: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.lightGray};\n }\n`\n\nexport const TertiaryButton = styled.button`\n background-color: ${p => p.theme.color.white};\n border: 1px solid ${p => p.theme.color.white};\n color: ${p => p.theme.color.charcoal};\n\n :hover,\n &._hover {\n background-color: ${p => p.theme.color.blueYonder25};\n border: 1px solid ${p => p.theme.color.blueYonder25};\n color: ${p => p.theme.color.blueYonder};\n }\n\n :active,\n &._active {\n background-color: ${p => p.theme.color.blueGray25};\n border: 1px solid ${p => p.theme.color.blueGray};\n color: ${p => p.theme.color.blueGray};\n }\n\n :disabled,\n &._disabled {\n background-color: ${p => p.theme.color.white};\n border: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.lightGray};\n }\n`\n","import classnames from 'classnames'\nimport { useMemo, type MouseEvent, type ButtonHTMLAttributes, type FunctionComponent, useCallback } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { PrimaryButton, SecondaryButton } from './Button'\nimport { Accent, Size } from '../constants'\nimport { type IconProps } from '../types'\nimport { stopMouseEventPropagation } from '../utils/stopMouseEventPropagation'\n\nconst ICON_SIZE_IN_PX: Record = {\n [Size.LARGE]: 26,\n [Size.NORMAL]: 20,\n [Size.SMALL]: 14\n}\n\nexport type IconButtonProps = Omit, 'children'> & {\n Icon: FunctionComponent\n accent?: Accent | undefined\n color?: string | undefined\n /** In pixels, override `size` prop default values. */\n iconSize?: number | undefined\n /** Remove button border and padding. */\n isCompact?: boolean | undefined\n size?: Size | undefined\n /** Prevent onClick event propagation. */\n withUnpropagatedClick?: boolean | undefined\n}\nexport function IconButton({\n accent = Accent.PRIMARY,\n className,\n color,\n Icon,\n iconSize,\n isCompact,\n onClick,\n size = Size.NORMAL,\n type = 'button',\n withUnpropagatedClick = false,\n ...nativeProps\n}: IconButtonProps) {\n const handleClick = useCallback(\n (event: MouseEvent) => {\n if (withUnpropagatedClick) {\n stopMouseEventPropagation(event)\n }\n\n if (onClick) {\n onClick(event)\n }\n },\n [onClick, withUnpropagatedClick]\n )\n\n const commonChildren = useMemo(\n () => ,\n [color, Icon, iconSize, size]\n )\n\n const commonProps = useMemo(\n () => ({\n children: commonChildren,\n className: classnames('Element-IconButton', className),\n isCompact,\n onClick: handleClick,\n size,\n type,\n ...nativeProps\n }),\n [className, commonChildren, handleClick, isCompact, nativeProps, size, type]\n )\n\n switch (accent) {\n case Accent.SECONDARY:\n return \n\n case Accent.TERTIARY:\n return \n\n default:\n return \n }\n}\n\nconst PADDING: Record = {\n [Size.LARGE]: '7px',\n [Size.NORMAL]: '5px',\n [Size.SMALL]: '3px'\n}\n\n// We can't use $-prefixed props here for some reason (maybe because the `as` prop exclude them?).\nconst StyledButton = styled.button<{\n isCompact: boolean | undefined\n size: Size\n}>`\n align-items: center;\n display: flex;\n justify-content: center;\n padding: ${p => (p.isCompact ? 0 : PADDING[p.size])};\n\n ${p =>\n p.isCompact &&\n css`\n border: 0;\n\n :hover,\n &._hover {\n border: 0;\n }\n border: 0;\n\n :active,\n &._active {\n border: 0;\n }\n border: 0;\n\n :disabled,\n &._disabled {\n border: 0;\n }\n `}\n`\n\nconst TertiaryButton = styled.button<{\n isCompact: boolean | undefined\n}>`\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.charcoal};\n\n :hover,\n &._hover {\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.blueYonder};\n }\n\n :active,\n &._active {\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.blueGray};\n }\n\n :disabled,\n &._disabled {\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.lightGray};\n }\n`\n","import styled from 'styled-components'\n\nimport type { HTMLAttributes } from 'react'\n\nexport type IconBoxProps = HTMLAttributes & {\n $color?: string | undefined\n /** In pixels */\n $size?: number | undefined\n}\n/**\n * Internal component used to wrap SVG icon components\n */\nexport const IconBox = styled.div.attrs(() => ({\n className: 'Element-IconBox'\n}))`\n display: inline-block;\n color: ${p => p.$color ?? 'inherit'};\n\n > svg {\n display: block;\n height: ${p => p.$size ?? 20}px;\n width: ${p => p.$size ?? 20}px;\n }\n`\n","import { createGlobalStyle } from 'styled-components'\n\n// @ts-ignore\nimport MarianneBold from './assets/fonts/Marianne-Bold.woff2'\n// @ts-ignore\nimport MarianneBoldItalic from './assets/fonts/Marianne-Bold_Italic.woff2'\n// @ts-ignore\nimport MarianneLight from './assets/fonts/Marianne-Light.woff2'\n// @ts-ignore\nimport MarianneLightItalic from './assets/fonts/Marianne-Light_Italic.woff2'\n// @ts-ignore\nimport MarianneMedium from './assets/fonts/Marianne-Medium.woff2'\n// @ts-ignore\nimport MarianneMediumItalic from './assets/fonts/Marianne-Medium_Italic.woff2'\n// @ts-ignore\nimport MarianneRegular from './assets/fonts/Marianne-Regular.woff2'\n// @ts-ignore\nimport MarianneItalic from './assets/fonts/Marianne-Regular_Italic.woff2'\n\nexport const GlobalStyle = createGlobalStyle`\n @font-face {\n font-family: Marianne;\n src: local('Marianne'), local('Marianne-Regular'), url(${MarianneRegular}) format('woff2');\n font-weight: normal;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin'), url(${MarianneLight}) format('woff2');\n font-weight: 300;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Medium'), url(${MarianneMedium}) format('woff2');\n font-weight: 500;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Medium_Italic'), url(${MarianneMediumItalic}) format('woff2');\n font-weight: 500;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin_Italic'), url(${MarianneLightItalic}) format('woff2');\n font-weight: lighter;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Regular_Italic'), url(${MarianneItalic}) format('woff2');\n font-weight: normal;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold'), url(${MarianneBold}) format('woff2');\n font-weight: 700;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold_Italic'), url(${MarianneBoldItalic}) format('woff2');\n font-style: italic;\n font-weight: 700;\n }\n\n body {\n font-family: Marianne, sans-serif;\n font-size: 16px;\n line-height: 1.3846;\n }\n`\n","/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */\n\nimport type { PartialDeep } from 'type-fest'\n\nexport type Theme = typeof THEME\nexport type PartialTheme = PartialDeep\n\nexport const THEME = {\n // https://xd.adobe.com/view/b6d4c472-3fbe-4dec-9f14-38fe03872a3e-e387/screen/b9bdc1ba-5f07-4c4f-bd44-2d38b2c6f663/specs/\n color: {\n /** INTERFACE COLORS */\n\n // Neutral Colors\n gunMetal: '#282F3E',\n // TODO Make that charcoal object 100 & 50\n charcoal: '#3B4559',\n charcoalShadow: 'rgba(59, 69, 89, 0.5)',\n slateGray: '#707785',\n lightGray: '#CCCFD6',\n gainsboro: '#E5E5EB',\n cultured: '#F7F7FA',\n white: '#FFFFFF',\n\n // Accentuation Colors\n blueYonder: '#567A9E',\n blueYonder25: '#D4DDE7',\n blueGray: '#5697D2',\n blueGray25: '#D4E5F4',\n maximumRed: '#E1000F',\n maximumRed15: '#FBD9DB',\n babyBlueEyes: '#99C9FF',\n\n // Notification Colors\n mediumSeaGreen: '#29B361',\n mediumSeaGreen25: '#c9ecd7',\n goldenPoppy: '#FAC11A',\n goldenPoppy25: '#FDF3C3',\n\n /** CONTEXTUAL COLORS */\n\n // Mission status\n yellowGreen: '#8CC800',\n\n // Risk Factor\n cadetGray: '#8E9A9F',\n grullo: '#B89B8C',\n copperRed: '#CF6A4E',\n chineseRed: '#A13112',\n\n // Vessel Track\n darkCornflowerBlue: '#2A4670',\n jungleGreen: '#1C9B7B',\n\n // Beacon Malfunction\n powderBlue: '#9ED7D9',\n wheat: '#EDD6A4',\n opal: '#A5BCC0',\n\n // Regulation Areas\n yaleBlue: '#295375',\n queenBlue: '#367096',\n glaucous: '#6284A6',\n blueNcs: '#3690C0',\n iceberg: '#67A9CF',\n lightSteelBlue: '#9AB4D6',\n lightPeriwinkle: '#CDCFEA',\n aliceBlue: '#EBF0F4',\n lightBlue: '#B9DDE5',\n lightCyan: '#C7EAE5', // deprecated ?\n middleBlueGreen: '#91CFC9', // deprecated ?\n verdigris: '#56B3AB', // deprecated ?\n viridianGreen: '#01A29D', // deprecated ?\n paoloVeroneseGreen: '#21977F', // deprecated ?\n skobeloff: '#01686B', // deprecated ?\n blueSapphire: '#01536A', // deprecated ?\n indigoDye: '#033E54', // deprecated ?\n skyBlue: '#77C1DE',\n frenchBlue: '#2E75AB',\n prussianBlue: '#003E54',\n lightCoral: '#FA8282',\n\n // AMP Zones\n brownSugar: '#B26A53',\n rust: '#B1502F',\n burntSienna: '#D46E49',\n persianOrange: '#D6814F',\n jasper: '#DB503D',\n bittersweet: '#F0755C',\n coral: '#F78A69',\n peach: '#FCB394',\n apricot: '#F0C1A1',\n melon: '#E7A58D',\n paleDogwood: '#F8D7CE',\n seashell: '#FCECE4',\n\n // Custom Zones\n darkGoldenrod: '#A98A0F',\n pear: '#DBE33E',\n jonquil: '#F0CB38',\n earthYellow: '#E6B771',\n ecru: '#BAAB68',\n goldMetallic: '#C5A730',\n mindaro: '#F2F58E'\n }\n}\n","import { createGlobalStyle } from 'styled-components'\n\n// @ts-ignore\nimport MarianneBold from './assets/fonts/Marianne-Bold.woff2'\n// @ts-ignore\nimport MarianneBoldItalic from './assets/fonts/Marianne-Bold_Italic.woff2'\n// @ts-ignore\nimport MarianneLight from './assets/fonts/Marianne-Light.woff2'\n// @ts-ignore\nimport MarianneLightItalic from './assets/fonts/Marianne-Light_Italic.woff2'\n// @ts-ignore\nimport MarianneMedium from './assets/fonts/Marianne-Medium.woff2'\n// @ts-ignore\nimport MarianneMediumItalic from './assets/fonts/Marianne-Medium_Italic.woff2'\n// @ts-ignore\nimport MarianneRegular from './assets/fonts/Marianne-Regular.woff2'\n// @ts-ignore\nimport MarianneItalic from './assets/fonts/Marianne-Regular_Italic.woff2'\n\nexport const OnlyFontGlobalStyle = createGlobalStyle`\n @font-face {\n font-family: Marianne;\n src: local('Marianne'), local('Marianne-Regular'), url(${MarianneRegular}) format('woff2');\n font-weight: normal;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin'), url(${MarianneLight}) format('woff2');\n font-weight: 300;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Medium'), url(${MarianneMedium}) format('woff2');\n font-weight: 500;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Medium_Italic'), url(${MarianneMediumItalic}) format('woff2');\n font-weight: 500;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin_Italic'), url(${MarianneLightItalic}) format('woff2');\n font-weight: lighter;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Regular_Italic'), url(${MarianneItalic}) format('woff2');\n font-weight: normal;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold'), url(${MarianneBold}) format('woff2');\n font-weight: 700;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold_Italic'), url(${MarianneBoldItalic}) format('woff2');\n font-style: italic;\n font-weight: 700;\n }\n\n body {\n font-family: Marianne, sans-serif;\n }\n`\n","import styled from 'styled-components'\n\nexport const Action = styled.div`\n background-color: ${p => p.theme.color.white};\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n display: flex;\n flex-direction: column-reverse;\n padding: 8px 8px 8px 8px;\n @media (min-width: 740px) {\n align-items: center;\n flex-direction: row;\n justify-content: center;\n padding: 48px 8px 48px 8px;\n }\n\n > button {\n margin-bottom: 2px;\n }\n @media (min-width: 740px) {\n > button {\n margin-bottom: 0;\n margin-right: 2px;\n }\n }\n`\n","import styled from 'styled-components'\n\nexport const Body = styled.div`\n background-color: ${p => p.theme.color.white};\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n display: flex;\n flex-direction: column;\n padding: 8px 8px 8px 8px;\n text-align: center;\n @media (min-width: 740px) {\n padding: 48px 8px 8px 8px;\n text-align: center;\n }\n\n > p {\n color: ${p => p.theme.color.slateGray};\n padding-top: 2px;\n }\n`\n","import styled from 'styled-components'\n\nexport const Title = styled.h4`\n font-size: 125%;\n font-weight: 500;\n line-height: 48px;\n padding-bottom: 2px;\n height: 48px;\n color: ${p => p.theme.color.white};\n background-color: ${p => p.theme.color.charcoal};\n text-align: center;\n`\n","import classnames from 'classnames'\nimport styled from 'styled-components'\n\nimport { Action } from './Action'\nimport { Body } from './Body'\nimport { Title } from './Title'\nimport { stopMouseEventPropagation } from '../../utils/stopMouseEventPropagation'\n\nimport type { HTMLAttributes } from 'react'\n\nexport type DialogProps = HTMLAttributes & {\n isAbsolute?: boolean\n}\nexport function RawDialog({ children, className, isAbsolute = false, ...nativeProps }: DialogProps) {\n const controlledClassName = classnames('Component-Dialog', className)\n\n return (\n \n \n\n {children}\n \n )\n}\n\nexport const Box = styled.div<{\n $isAbsolute: boolean\n}>`\n position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow-y: auto;\n z-index: 9000;\n`\n\nconst Overlay = styled.div<{\n $isAbsolute: boolean\n}>`\n background-color: ${p => p.theme.color.charcoal};\n bottom: 0;\n left: 0;\n opacity: 0.53;\n position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};\n right: 0;\n top: 0;\n z-index: 1;\n`\n\nconst Window = styled.div<{\n $isAbsolute: boolean\n}>`\n border-radius: 2px;\n bottom: 100px;\n box-shadow: 4px;\n max-width: 32rem;\n position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};\n width: calc(100% - 2 * 8px);\n z-index: 1;\n @media (min-width: 740px) {\n bottom: auto;\n min-width: 586px;\n }\n`\n\nRawDialog.displayName = 'Dialog'\n\nexport const Dialog = Object.assign(RawDialog, {\n Action,\n Body,\n Title\n})\n","import { useMemo } from 'react'\nimport { Dropdown as RsuiteDropdown } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Accent } from '../../constants'\n\nimport type { IconProps } from '../../types'\nimport type { FunctionComponent } from 'react'\nimport type { DropdownMenuItemProps as RsuiteDropdownMenuItemProps } from 'rsuite'\n\nexport type DropdownItemProps = Omit & {\n Icon?: FunctionComponent\n accent?: Accent | undefined\n}\nexport function Item({ accent, Icon, ...originalProps }: DropdownItemProps) {\n const icon = useMemo(() => (Icon ? : undefined), [Icon])\n const hasIcon = useMemo(() => Boolean(Icon), [Icon])\n\n switch (accent) {\n case Accent.SECONDARY:\n return \n\n default:\n return \n }\n}\n\n// TODO We need to split that into multiple styled components as done in `\n\n <>\n {zones.map((zone, index) => (\n // eslint-disable-next-line react/no-array-index-key\n \n \n {zone[labelPropName]}\n\n {/* TODO Add `Accent.LINK` accent in @mtes-mct/monitor-ui and use it here. */}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n centerZone(zone)}>\n \n Centrer sur la carte\n \n \n\n editZone(index, zone)} />\n deleteZone(index)}\n />\n \n ))}\n \n\n {hasError && {controlledError}}\n \n )\n}\n\nconst Row = styled.div`\n align-items: center;\n display: flex;\n margin: 8px 0 0;\n\n > button {\n margin: 0 0 0 8px;\n }\n`\n\nconst ZoneBox = styled.div<{\n $isLight: boolean\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n display: flex;\n flex-grow: 1;\n font-size: 13px;\n line-height: 1.3077; // = 17px\n justify-content: space-between;\n padding: 6px 12px 6px;\n`\n\nconst Link = styled.a`\n align-items: center;\n cursor: pointer;\n display: inline-flex;\n\n > span {\n line-height: 1;\n margin: -2px 0 0 8px;\n }\n`\n","import classnames from 'classnames'\nimport { useCallback, useMemo, useRef, type FocusEvent } from 'react'\nimport { Input, type InputProps } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { Label } from '../elements/Label'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useKey } from '../hooks/useKey'\nimport { usePreventWheelEvent } from '../hooks/usePreventWheelEvent'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { Promisable } from 'type-fest'\n\nexport type NumberInputProps = Omit & {\n error?: string | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: number | undefined) => Promisable) | undefined\n value?: number | undefined\n}\nexport function NumberInput({\n className,\n error,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isUndefinedWhenDisabled = false,\n label,\n onBlur,\n onChange,\n onFocus,\n style,\n value,\n ...originalProps\n}: NumberInputProps) {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null)\n\n const controlledClassname = useMemo(() => classnames('Field-NumberInput', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([originalProps.disabled, originalProps.name])\n\n const preventWheelEvent = usePreventWheelEvent(inputRef)\n\n const handleChange = useCallback(\n (nextValue: string) => {\n if (!onChange) {\n return\n }\n\n const normalizedNextValueAsString = nextValue && nextValue.length ? nextValue : undefined\n const nextValueAsNumber = Number(normalizedNextValueAsString)\n const normalizedNextValue = !Number.isNaN(nextValueAsNumber) ? nextValueAsNumber : undefined\n\n onChange(normalizedNextValue)\n },\n [onChange]\n )\n\n const handleBlur = useCallback(\n (event: FocusEvent) => {\n event.target.removeEventListener('wheel', preventWheelEvent)\n\n if (onBlur) {\n onBlur(event)\n }\n },\n [onBlur, preventWheelEvent]\n )\n\n const handleFocus = useCallback(\n (event: FocusEvent) => {\n event.target.addEventListener('wheel', preventWheelEvent)\n\n if (onFocus) {\n onFocus(event)\n }\n },\n [onFocus, preventWheelEvent]\n )\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange)\n\n return (\n \n \n {label}\n \n\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst StyledInput = styled(Input as any)<{\n $hasError: boolean\n $isLight: boolean\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};\n border-radius: 0;\n font-size: 13px;\n /* TODO It should be 18px but computed line-height is stuck to min. 18.5px. Investigate that. */\n line-height: 19px;\n padding: 3px 8px 6px;\n vertical-align: center;\n width: 100%;\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n outline: 0;\n }\n`\n","import { useMemo, useRef, useState } from 'react'\nimport styled from 'styled-components'\nimport { useDebouncedCallback } from 'use-debounce'\n\nimport { THEME } from '../../theme'\nimport { isNumeric } from '../../utils/isNumeric'\n\nimport type { Coordinates } from '../../types'\n\ntype DDCoordinatesInputProps = {\n coordinates: Coordinates | undefined\n disabled: boolean | undefined\n isLight: boolean | undefined\n onChange: (nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void\n}\n// TODO This field should return undefined when cleared (i.e.: Select all & Backspace/Delete)\nexport function DDCoordinatesInput({\n coordinates,\n disabled = false,\n isLight = false,\n onChange\n}: DDCoordinatesInputProps) {\n const latitudeInputRef = useRef()\n const longitudeInputRef = useRef()\n\n const [latitudeError, setLatitudeError] = useState('')\n const [longitudeError, setLongitudeError] = useState('')\n\n const defaultValue = useMemo(() => {\n if (!coordinates) {\n return undefined\n }\n\n const [latitude, longitude] = coordinates\n\n if (isNumeric(latitude) && isNumeric(longitude)) {\n return {\n latitude: Number(latitude),\n longitude: Number(longitude)\n }\n }\n\n return {\n latitude: undefined,\n longitude: undefined\n }\n }, [coordinates])\n\n const handleChange = useDebouncedCallback((nextCoordinates: [number, number] | undefined) => {\n if (!latitudeInputRef.current || !longitudeInputRef.current) {\n return\n }\n\n const latitudeAsString = latitudeInputRef.current.value\n const longitudeAsString = longitudeInputRef.current.value\n\n setLongitudeError('')\n setLatitudeError('')\n\n if (!isNumeric(latitudeAsString)) {\n setLatitudeError('Champ Latitude incorrect')\n\n return\n }\n\n if (!isNumeric(longitudeAsString)) {\n setLongitudeError('Champ Longitude incorrect')\n\n return\n }\n\n const latitude = Number(latitudeAsString)\n const longitude = Number(longitudeAsString)\n\n onChange([latitude, longitude], nextCoordinates)\n }, 500)\n\n return (\n \n handleChange(coordinates)}\n placeholder=\"Latitude\"\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,\n border: latitudeError ? '1px solid red' : undefined\n }}\n />\n handleChange(coordinates)}\n placeholder=\"Longitude\"\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,\n border: longitudeError ? '1px solid red' : undefined\n }}\n />\n (DD)\n {latitudeError}\n {longitudeError}\n \n )\n}\n\nconst DDInput = styled.input`\n margin-right: 5px !important;\n width: 100px;\n`\n\nconst CoordinatesType = styled.span`\n margin-left: 7px;\n color: ${p => p.theme.color.slateGray};\n`\n\nconst Error = styled.span`\n color: red;\n display: block;\n`\n\nconst Box = styled.div`\n font-size: 13px;\n text-align: left;\n`\n","import { useEffect, useState } from 'react'\nimport { dmsToDecimal } from 'react-coordinate-input'\nimport { IMaskInput } from 'react-imask'\nimport styled from 'styled-components'\n\nimport { CoordinatesFormat, WSG84_PROJECTION } from '../../constants'\nimport { THEME } from '../../theme'\nimport { getCoordinates } from '../../utils/coordinates'\nimport { isNumeric } from '../../utils/isNumeric'\n\nimport type { Coordinates } from '../../types'\n\n// TODO Remove that once the fix is added and released.\n// Open issue: https://github.com/uNmAnNeR/imaskjs/issues/761\nconst UntypedIMaskInput: any = IMaskInput\n\ntype DMDCoordinatesInputProps = {\n coordinates: Coordinates | undefined\n coordinatesFormat: CoordinatesFormat\n disabled: boolean | undefined\n isLight: boolean | undefined\n onChange: (nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void\n}\n// TODO This field should return undefined when cleared (i.e.: Select all & Backspace/Delete)\nexport function DMDCoordinatesInput({\n coordinates,\n coordinatesFormat,\n disabled = false,\n isLight,\n onChange\n}: DMDCoordinatesInputProps) {\n const [error, setError] = useState('')\n const [value, setValue] = useState('')\n\n useEffect(() => {\n if (coordinates?.length && coordinatesFormat) {\n const nextValue = getCoordinates(\n [coordinates[1], coordinates[0]],\n WSG84_PROJECTION,\n CoordinatesFormat.DEGREES_MINUTES_DECIMALS\n )\n .map(coordinate => coordinate.replace(/[°′. ]/g, ''))\n .join('')\n\n setValue(nextValue)\n } else {\n setValue('')\n }\n }, [coordinates, coordinatesFormat])\n\n function completeCoordinates(mask) {\n setError('')\n\n // eslint-disable-next-line no-underscore-dangle\n const latitude = mask._unmaskedValue.substring(0, 7)\n // eslint-disable-next-line no-underscore-dangle\n const longitude = mask._unmaskedValue.substring(7, mask._unmaskedValue.length)\n const NS = latitude[latitude.length - 1].toUpperCase()\n if (!['N', 'S'].includes(NS)) {\n setError('La latitude doit être N ou S')\n\n return\n }\n const latitudeDegrees = parseInt(latitude.substring(0, 2), 10)\n if (latitudeDegrees < 0 || latitudeDegrees > 90) {\n setError('La latitude doit être comprise entre 0 et 90°')\n\n return\n }\n const latitudeMinutes = parseInt(latitude.substring(2, 4), 10)\n const latitudeSeconds = parseInt(latitude.substring(4, 6), 10)\n\n const EW = longitude[longitude.length - 1].toUpperCase()\n if (!['E', 'W'].includes(EW)) {\n setError('La longitude doit être E ou W')\n\n return\n }\n const longitudeDegrees = parseInt(longitude.substring(0, 3), 10)\n if (longitudeDegrees < 0 || longitudeDegrees > 180) {\n setError('La longitude doit être comprise entre 0 et 180°')\n\n return\n }\n const longitudeMinutes = parseInt(longitude.substring(3, 5), 10)\n const longitudeSeconds = parseInt(longitude.substring(5, 7), 10)\n\n const dLatitude = dmsToDecimal(latitudeDegrees, latitudeMinutes + 10 ** -2 * latitudeSeconds, 0, NS, 6)\n const dLongitude = dmsToDecimal(longitudeDegrees, longitudeMinutes + 10 ** -2 * longitudeSeconds, 0, EW, 6)\n\n if (isNumeric(dLatitude) && isNumeric(dLongitude)) {\n onChange([dLatitude as number, dLongitude as number], coordinates)\n } else {\n setError('Format lat/long invalide')\n }\n }\n\n return (\n \n setValue(mask.value)}\n onComplete={(_, mask) => completeCoordinates(mask)}\n placeholder=\"__° __.___′ _ ___° __.___′\"\n radix=\".\"\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,\n border: error ? '1px solid red' : undefined\n }}\n // TODO Use `defaultValue` here.\n value={value}\n />\n (DMD)\n {error}\n \n )\n}\n\nconst CoordinatesType = styled.span`\n margin-left: 7px;\n color: ${p => p.theme.color.slateGray};\n`\n\nconst Error = styled.span`\n color: ${p => p.theme.color.maximumRed};\n display: inline-block;\n`\n\nconst Box = styled.div`\n font-size: 13px;\n text-align: left;\n`\n","import { isEmpty } from 'ramda'\nimport { useCallback, useMemo } from 'react'\nimport CoordinateInput from 'react-coordinate-input'\nimport styled from 'styled-components'\n\nimport { THEME } from '../../theme'\n\nimport type { CoordinatesFormat } from '../../constants'\nimport type { Coordinates } from '../../types'\n\ntype DMSCoordinatesInputProps = {\n coordinates: Coordinates | undefined\n coordinatesFormat: CoordinatesFormat\n disabled: boolean | undefined\n isLight: boolean | undefined\n onChange: (nextCoordinates: Coordinates | undefined, coordinates: Coordinates | undefined) => void\n}\nexport function DMSCoordinatesInput({\n coordinates,\n coordinatesFormat,\n disabled = false,\n isLight,\n onChange\n}: DMSCoordinatesInputProps) {\n /** Convert the coordinates to the [latitude, longitude] string format */\n const defaultValue = useMemo(() => {\n if (!coordinates?.length || !coordinatesFormat) {\n return ''\n }\n\n return coordinates?.join(', ') || ''\n }, [coordinates, coordinatesFormat])\n\n const update = useCallback(\n nextCoordinates => {\n const normalizedNextCoordinates = !isEmpty(nextCoordinates) ? nextCoordinates : undefined\n\n onChange(normalizedNextCoordinates, coordinates)\n },\n [coordinates, onChange]\n )\n\n return (\n \n update(dd)}\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro\n }}\n // TODO Use `defaultValue` here.\n value={defaultValue}\n />\n (DMS)\n \n )\n}\n\nconst CoordinatesType = styled.span`\n margin-left: 7px;\n color: ${p => p.theme.color.slateGray};\n`\n\nconst Box = styled.div`\n font-size: 13px;\n text-align: left;\n`\n","import classnames from 'classnames'\nimport { noop } from 'lodash/fp'\nimport { useCallback, useMemo } from 'react'\nimport styled from 'styled-components'\n\nimport { DDCoordinatesInput } from './DDCoordinatesInput'\nimport { DMDCoordinatesInput } from './DMDCoordinatesInput'\nimport { DMSCoordinatesInput } from './DMSCoordinatesInput'\nimport { CoordinatesFormat } from '../../constants'\nimport { FieldError } from '../../elements/FieldError'\nimport { Fieldset } from '../../elements/Fieldset'\nimport { useFieldUndefineEffect } from '../../hooks/useFieldUndefineEffect'\nimport { normalizeString } from '../../utils/normalizeString'\n\nimport type { FieldsetProps } from '../../elements/Fieldset'\nimport type { Coordinates } from '../../types'\nimport type { Promisable } from 'type-fest'\n\nexport type CoordinatesInputProps = FieldsetProps & {\n coordinatesFormat: CoordinatesFormat\n defaultValue?: Coordinates | undefined\n disabled?: boolean | undefined\n error?: string | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n label: string\n onChange?:\n | ((nextCoordinates: Coordinates | undefined, coordinates: Coordinates | undefined) => Promisable)\n | undefined\n}\nexport function CoordinatesInput({\n className,\n coordinatesFormat,\n defaultValue,\n error,\n isLabelHidden = false,\n isLight = false,\n label,\n onChange = noop,\n ...nativeProps\n}: CoordinatesInputProps) {\n const controlledClassName = classnames('Field-CoordinatesInput', className)\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n\n const getCoordinatesInput = useCallback(() => {\n switch (coordinatesFormat) {\n case CoordinatesFormat.DEGREES_MINUTES_SECONDS:\n return (\n \n )\n\n case CoordinatesFormat.DEGREES_MINUTES_DECIMALS:\n return (\n \n )\n\n case CoordinatesFormat.DECIMAL_DEGREES:\n return (\n \n )\n\n default:\n return undefined\n }\n }, [defaultValue, nativeProps.disabled, onChange, coordinatesFormat, isLight])\n\n // TODO We must add a `handleDisable()` callback here to effectively empty the inputs when disabling this field.\n useFieldUndefineEffect(nativeProps.disabled, onChange /* , handleDisable */)\n\n return (\n \n {getCoordinatesInput()}\n\n {hasError && {controlledError}}\n \n )\n}\n\nconst StyledFieldset = styled(Fieldset as any)`\n input {\n background-color: ${p => (p.isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: ${p => (p.isLight ? `1px solid ${p.theme.color.lightGray}` : 'none')};\n color: ${p => p.theme.color.gunMetal};\n height: 33px;\n padding: 7px 11px;\n }\n`\n","import classnames from 'classnames'\nimport { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent, type ReactNode } from 'react'\nimport { SelectPicker, type SelectPickerProps } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { Label } from '../elements/Label'\nimport { useClickOutsideEffect } from '../hooks/useClickOutsideEffect'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useForceUpdate } from '../hooks/useForceUpdate'\nimport { useKey } from '../hooks/useKey'\nimport { type CustomSearch } from '../libs/CustomSearch'\nimport { type Option, type OptionAsRsuiteItemDataType, type OptionValueType } from '../types'\nimport { getRsuiteDataFromOptions } from '../utils/getRsuiteDataFromOptions'\nimport { getRsuiteValueFromOptionValue } from '../utils/getRsuiteValueFromOptionValue'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { Promisable } from 'type-fest'\n\nexport type SelectProps = Omit<\n SelectPickerProps,\n | 'as'\n | 'container'\n | 'data'\n | 'defaultValue'\n | 'id'\n | 'onChange'\n | 'open'\n | 'renderMenuItem'\n | 'renderValue'\n | 'value'\n | 'valueKey'\n> & {\n /** Used to pass something else than `window.document` as a base container to attach global events listeners. */\n baseContainer?: Document | HTMLDivElement | null | undefined\n customSearch?: CustomSearch> | undefined\n /** Minimum search query length required to trigger custom search filtering. */\n customSearchMinQueryLength?: number | undefined\n error?: string | undefined\n isCleanable?: boolean | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: OptionValue | undefined) => Promisable) | undefined\n optionValueKey?: keyof OptionValue | undefined\n options: Option[]\n value?: OptionValue | undefined\n}\nexport function Select({\n baseContainer,\n className,\n customSearch,\n customSearchMinQueryLength = 1,\n disabled = false,\n error,\n isCleanable = true,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isUndefinedWhenDisabled = false,\n label,\n onChange,\n options,\n optionValueKey,\n searchable = false,\n style,\n value,\n ...originalProps\n}: SelectProps) {\n // eslint-disable-next-line no-null/no-null\n const boxRef = useRef(null)\n /** Instance of `CustomSearch` */\n const customSearchRef = useRef(customSearch)\n\n const { forceUpdate } = useForceUpdate()\n\n const controlledClassname = useMemo(() => classnames('Field-Select', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const rsuiteData = useMemo(() => getRsuiteDataFromOptions(options, optionValueKey), [options, optionValueKey])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([disabled, originalProps.name, value])\n const selectedRsuiteValue = useMemo(\n () => getRsuiteValueFromOptionValue(value, optionValueKey),\n [value, optionValueKey]\n )\n\n // Only used when `customSearch` prop is set\n const [controlledRsuiteData, setControlledRsuiteData] = useState(customSearch ? rsuiteData : undefined)\n const [isOpen, setIsOpen] = useState(false)\n\n const close = useCallback(() => {\n setIsOpen(false)\n }, [])\n\n const handleClean = useCallback(() => {\n if (!onChange) {\n return\n }\n\n onChange(undefined)\n }, [onChange])\n\n const handleSearch = useCallback(\n (nextQuery: string) => {\n if (!customSearchRef.current || nextQuery.trim().length < customSearchMinQueryLength) {\n setControlledRsuiteData(rsuiteData)\n\n return\n }\n\n const nextControlledRsuiteData =\n nextQuery.trim().length >= customSearchMinQueryLength\n ? getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery), optionValueKey)\n : rsuiteData\n\n setControlledRsuiteData(nextControlledRsuiteData)\n },\n [customSearchMinQueryLength, optionValueKey, rsuiteData]\n )\n\n const handleSelect = useCallback(\n (_: string, selectedItem: OptionAsRsuiteItemDataType) => {\n close()\n\n if (onChange) {\n onChange(selectedItem.optionValue)\n }\n },\n [close, onChange]\n )\n\n const renderMenuItem = useCallback((node: ReactNode) => {String(node)}, [])\n\n const toggle = useCallback(\n (event: MouseEvent) => {\n if (disabled) {\n return\n }\n let targetElement = event.target as HTMLElement\n\n if (targetElement.tagName === 'path') {\n if (targetElement.parentElement) {\n targetElement = targetElement.parentElement\n }\n }\n\n if (\n targetElement.classList.contains('rs-picker-toggle') ||\n targetElement.classList.contains('rs-picker-toggle-value') ||\n targetElement.classList.contains('rs-stack-item') ||\n targetElement.classList.contains('rs-picker-toggle-caret') ||\n targetElement.classList.contains('rs-picker-toggle-placeholder')\n ) {\n setIsOpen(!isOpen)\n }\n },\n [isOpen, disabled]\n )\n\n const disabledItemValues = useMemo(\n () => (controlledRsuiteData ?? rsuiteData).filter(option => option.isDisabled).map(option => option.value),\n [controlledRsuiteData, rsuiteData]\n )\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && disabled, onChange)\n\n useClickOutsideEffect(boxRef, close, baseContainer)\n\n useEffect(() => {\n forceUpdate()\n }, [forceUpdate])\n\n return (\n \n \n\n \n {boxRef.current && (\n true : undefined) as any}\n value={selectedRsuiteValue}\n {...originalProps}\n />\n )}\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst StyledSelectPicker = styled(SelectPicker as any)<{\n $isLight: boolean\n}>`\n > .rs-picker-toggle {\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)} !important;\n border: 0;\n }\n`\n\nconst Box = styled.div<{\n $hasError: boolean\n}>`\n position: relative;\n user-select: none;\n width: 100%;\n\n > .rs-picker-select {\n width: 100%;\n\n > .rs-picker-toggle {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)} !important;\n font-size: 13px;\n line-height: 1.3846;\n padding: 4px 40px 6px 8px;\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n }\n\n > .rs-stack {\n > .rs-stack-item {\n > .rs-picker-toggle-placeholder {\n font-size: 13px;\n line-height: 1.3846;\n }\n\n > .rs-picker-toggle-clean.rs-btn-close {\n top: 4px !important;\n }\n\n > svg {\n height: 18px;\n margin-top: -2px;\n }\n }\n }\n }\n }\n\n > .rs-picker-menu {\n max-width: 100%;\n\n > .rs-picker-search-bar {\n > .rs-picker-search-bar-input {\n background-color: ${p => p.theme.color.white};\n border: solid 1px ${p => p.theme.color.lightGray};\n border-radius: 0;\n font-size: 13px;\n padding: 4px 8px 6px 8px;\n }\n\n > svg {\n color: ${p => p.theme.color.lightGray};\n top: 11px;\n }\n }\n\n > .rs-picker-select-menu {\n > div[role='option'] {\n > .rs-picker-select-menu-item {\n font-size: 13px;\n line-height: 1.3846;\n overflow: hidden;\n padding: 6px 12px 10px 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n }\n }\n`\n","import classnames from 'classnames'\nimport { useCallback, useMemo, useRef } from 'react'\nimport { Input } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { Label } from '../elements/Label'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useKey } from '../hooks/useKey'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { MutableRefObject, TextareaHTMLAttributes } from 'react'\nimport type { Promisable } from 'type-fest'\n\nexport type TextareaProps = Omit<\n TextareaHTMLAttributes,\n 'defaultValue' | 'id' | 'onChange' | 'value'\n> & {\n error?: string | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: string | undefined) => Promisable) | undefined\n value?: string | undefined\n}\nexport function Textarea({\n className,\n error,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isUndefinedWhenDisabled = false,\n label,\n onChange,\n rows = 3,\n style,\n value,\n ...originalProps\n}: TextareaProps) {\n const inputRef = useRef() as MutableRefObject\n\n const controlledClassname = useMemo(() => classnames('Field-Textarea', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([originalProps.disabled, originalProps.name])\n\n const handleChange = useCallback(() => {\n if (!onChange) {\n return\n }\n\n const nextValue = inputRef.current.value\n const normalizedNextValue = nextValue.trim().length ? nextValue : undefined\n\n onChange(normalizedNextValue)\n }, [onChange])\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange)\n\n return (\n \n \n {label}\n \n\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst StyledInput = styled(Input as any)<{\n $hasError: boolean\n $isLight: boolean\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};\n font-size: 13px;\n padding: 7px 11px;\n width: 100%;\n\n ::placeholder {\n color: ${p => (p.$isLight ? p.theme.color.slateGray : p.theme.color.slateGray)};\n }\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n outline: 0;\n }\n`\n","import classnames from 'classnames'\nimport { type FunctionComponent, useCallback, useMemo } from 'react'\nimport { Input } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Accent, Size } from '../constants'\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { IconButton } from '../elements/IconButton'\nimport { Label } from '../elements/Label'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useKey } from '../hooks/useKey'\nimport { Close, Search } from '../icons'\nimport { THEME } from '../theme'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { IconProps } from '../types'\nimport type { InputProps } from 'rsuite'\nimport type { Promisable } from 'type-fest'\n\nexport type TextInputProps = Omit & {\n Icon?: FunctionComponent | undefined\n error?: string | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isSearchInput?: boolean\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: string | undefined) => Promisable) | undefined\n size?: Size | undefined\n value?: string | undefined\n}\nexport function TextInput({\n className,\n error,\n Icon,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isSearchInput = false,\n isUndefinedWhenDisabled = false,\n label,\n onChange,\n size = Size.NORMAL,\n style,\n type = 'text',\n value,\n ...originalProps\n}: TextInputProps) {\n const controlledClassname = useMemo(() => classnames('Field-TextInput', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([originalProps.disabled, originalProps.name])\n\n const clean = useCallback(() => {\n if (!onChange) {\n return\n }\n onChange(undefined)\n }, [onChange])\n\n const handleChange = useCallback(\n (nextValue: string | null) => {\n if (!onChange) {\n return\n }\n\n const normalizedNextValue = nextValue && nextValue.trim().length ? nextValue : undefined\n\n onChange(normalizedNextValue)\n },\n [onChange]\n )\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange)\n\n return (\n \n \n {label}\n \n\n \n \n {isSearchInput && !Icon && (\n \n {value && (\n <>\n \n \n \n )}\n\n \n \n )}\n\n {Icon && }\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst PADDING: Record = {\n [Size.LARGE]: '8px 16px 11px',\n [Size.NORMAL]: '3px 8px 6px',\n [Size.SMALL]: '3px 8px 6px'\n}\nconst PADDING_WITH_ICON: Record = {\n [Size.LARGE]: '8px 40px 11px 16px',\n [Size.NORMAL]: '3px 38px 6px 8px',\n [Size.SMALL]: '3px 38px 6px 8px'\n}\n\nconst IconsContainer = styled.div<{\n $size: Size\n}>`\n align-items: center;\n display: flex;\n position: absolute;\n right: 5px;\n top: ${p => (p.$size === Size.LARGE ? '10px' : '5px')};\n`\n\nconst Separator = styled.div`\n border-right: 1px solid ${p => p.theme.color.lightGray};\n height: 20px;\n margin-left: 4px;\n margin-right: 6px;\n padding-top: 3px;\n`\n\nconst StyledInput = styled(Input as any)<{\n $hasError: boolean\n $hasIcon: boolean\n $isLight: boolean\n $size: Size\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};\n border-radius: 0;\n font-size: 13px;\n /* TODO It should be 18px but computed line-height is stuck to min. 18.5px. Investigate that. */\n line-height: 19px;\n padding: ${p => (p.$hasIcon ? PADDING_WITH_ICON[p.$size] : PADDING[p.$size])};\n vertical-align: center;\n width: 100%;\n\n ::placeholder {\n color: ${p => (p.$isLight ? p.theme.color.slateGray : p.theme.color.slateGray)};\n }\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n outline: 0;\n }\n`\n\nconst InputBox = styled.div<{\n $size: Size\n}>`\n position: relative;\n width: 100%;\n > .Element-IconBox {\n position: absolute;\n right: 10px;\n top: ${p => (p.$size === Size.LARGE ? '10px' : '5px')};\n }\n`\n","import classnames from 'classnames'\nimport styled from 'styled-components'\n\nimport type { TableHTMLAttributes } from 'react'\n\nconst Table = styled.table.attrs>(props => ({\n className: classnames('Table-SimpleTable', props.className)\n}))`\n width: 100%;\n table-layout: auto;\n overflow: auto;\n border-collapse: separate;\n`\nconst Head = styled.thead`\n position: sticky;\n top: 0;\n z-index: 1;\n\n th:first-child {\n border-left: 1px solid ${p => p.theme.color.lightGray};\n }\n`\n\nconst SortContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: default;\n\n &.cursor-pointer {\n cursor: pointer;\n }\n`\nconst Th = styled.th`\n background-color: ${p => p.theme.color.gainsboro};\n border-top: 1px solid ${p => p.theme.color.lightGray};\n border-bottom: 1px solid ${p => p.theme.color.lightGray};\n border-right: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.slateGray};\n font-size: 13px;\n font-weight: 500;\n padding: 10px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`\n\nconst BodyTr = styled.tr`\n :hover {\n > td {\n background-color: ${p => p.theme.color.blueYonder25};\n }\n }\n td:first-child {\n border-left: 1px solid ${p => p.theme.color.lightGray};\n }\n`\n\nconst Td = styled.td<{ $isCenter?: boolean }>`\n font-size: 13px;\n font-weight: 500;\n color: ${p => p.theme.color.gunMetal};\n text-align: ${p => (p.$isCenter ? 'center' : 'left')};\n border-bottom: 1px solid ${p => p.theme.color.lightGray};\n border-right: 1px solid ${p => p.theme.color.lightGray};\n overflow: hidden;\n padding: 10px;\n text-overflow: ellipsis;\n white-space: nowrap;\n`\n\nexport const SimpleTable = {\n BodyTr,\n Head,\n SortContainer,\n Table,\n Td,\n Th\n}\n","import styled from 'styled-components'\n\nimport { Chevron } from '../../icons'\n\nexport const SortingIcon = styled(Chevron as any)<{\n $isDescending?: boolean\n}>`\n cursor: pointer;\n height: 16px;\n margin-right: 8px;\n margin-top: 0px;\n transform: ${props => (!props.$isDescending ? 'rotate(0deg)' : 'rotate(-180deg)')};\n transition: all 0.5s;\n width: 16px;\n`\n","import { flexRender, type Header } from '@tanstack/react-table'\n\nimport { SortingIcon } from './SortingIcon'\nimport { SortingArrows } from '../../icons'\nimport { SimpleTable } from '../SimpleTable'\n\nimport type { ReactNode } from 'react'\n\nexport type ThProps = {\n children?: ReactNode\n header: Header\n}\nexport function Th({ children, header }: ThProps) {\n const controlledChildren =\n children ?? !header.isPlaceholder ? (\n \n {flexRender(header.column.columnDef.header, header.getContext())}\n\n {header.column.getCanSort() &&\n ({\n asc: ,\n desc: \n }[header.column.getIsSorted() as string] ?? )}\n \n ) : undefined\n\n return (\n \n {controlledChildren}\n \n )\n}\n","import styled from 'styled-components'\n\nimport { RowCheckbox } from './RowCheckbox'\nimport { SimpleTable } from '../SimpleTable'\n\nexport { RowCheckbox }\n\nconst Table = styled(SimpleTable.Table)`\n border-collapse: separate;\n border-spacing: 0 5px;\n table-layout: fixed;\n`\nconst Head = styled(SimpleTable.Head)`\n th:last-child {\n border-right: 1px solid ${p => p.theme.color.lightGray};\n }\n`\n\nconst SortContainer = styled(SimpleTable.SortContainer)`\n justify-content: start;\n gap: 8px;\n`\nconst Th = styled(SimpleTable.Th)<{ $width: number }>`\n background-color: ${p => p.theme.color.white};\n border-top: 1px solid ${p => p.theme.color.lightGray};\n border-bottom: 1px solid ${p => p.theme.color.lightGray};\n border-right: none;\n padding: 2px 16px;\n width: ${p => p.$width}px;\n`\n\nconst BodyTr = styled(SimpleTable.BodyTr)<{ $isHighlighted?: boolean }>`\n td:first-child {\n border-left: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n }\n td:last-child {\n border-right: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n overflow: visible;\n }\n`\n\nconst Td = styled(SimpleTable.Td)<{ $hasRightBorder: boolean; $isHighlighted?: boolean; $width: number }>`\n background-color: ${p => p.theme.color.cultured};\n border-top: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n border-bottom: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n border-right: none;\n padding: 4px 16px;\n border-right: ${p => (p.$hasRightBorder ? `1px solid ${p.theme.color.lightGray}` : '')};\n width: ${p => p.$width}px;\n`\n\nexport const TableWithSelectableRows = {\n BodyTr,\n Head,\n RowCheckbox,\n SortContainer,\n Table,\n Td,\n Th\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/main.44e1b471.iframe.bundle.js.map b/main.44e1b471.iframe.bundle.js.map deleted file mode 100644 index 8ab69dd2f..000000000 --- a/main.44e1b471.iframe.bundle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.44e1b471.iframe.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;AAkCA;AC7BA;AACA;;;;;;AAQA;;AAEA;;;;;AAOA;AAGA;;;;;;;AASA;;;;AAMA;AACA;AAiBA;;AAGA;AAZA;;;;;;;AAcA;;;ACoCA;;;AAGA;AACA;;;;;;AAQA;;;;;;;AASA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;AAKA;AACA;AACA;;AAIA;;AAEA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;;AAMA;AACA;;AAIA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;AAKA;AACA;AACA;;;;;;ACrGA;;AAEA;;;;;;;;;;;;;;;;;;;;AAwBA;;AAIA;AACA;;;;;AAKA;AACA;;;;;;AAMA;AACA;;;;;;AAMA;AACA;;;;ACpIA;;;;AAIA;AACA;;;;;ACCA;;;;;;AAMA;;;;;;AAMA;;;;;;AAMA;;;;;;;AAOA;;;;;;;AAOA;;;;;;;AAOA;;;;;;AAMA;;;;;;;;;;AC5DA;;;ACeA;;;;;;AAMA;;;;;;AAMA;;;;;;AAMA;;;;;;;AAOA;;;;;;;AAOA;;;;;;;AAOA;;;;;;AAMA;;;;;;;;AD5DA;AEJA;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;AAaA;;;;;;;;;ACRA;AACA;;;ACmBA;;;;;;;;;;AAYA;AAGA;;;;AAIA;;;;AAMA;;;;;AAOA;;;;;;;AASA;ACtCA;AACA;;;;;AAKA;AACA;AACA;;;;;AAMA;;;;;AAOA;;;;;;;;;;;;ACfA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;;;AAIA;AACA;AACA;;;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;AAMA;;;;;;AAMA;;;;;;;;;;;;;AAeA;;ACzFA;;AAEA;AACA;;;;;;AAMA;;;AAGA;;;;AAIA;;;;;;;ACvBA;;;;;;;;;;;AAaA;;;;ACsBA;AACA;AACA;;;;;;;AASA;AACA;;;;;;AAMA;;;;;AAKA;;;;;AAKA;;AAIA;AACA;AACA;AAGA;AACA;AACA;;;;AAIA;AACA;;;;;AAKA;AACA;;;;;AAKA;AACA;;;AChGA;;AAEA;;;;;;;;;;;;;;;ACwBA;AAIA;AACA;;;;;AAOA;;;;;;;AClCA;AAGA;;;;;;;;;;;;ACiCA;AAKA;AACA;;;AAGA;AAGA;;;AClDA;AACA;;;;;;ACCA;AAGA;;;;;ACkFA;;AAEA;AAOA;;AAEA;;;AAGA;;;;;;;;;;;AAWA;;AAIA;AAGA;AACA;AAIA;AAGA;AACA;AAGA;AAGA;AACA;;;;;;;;;ACqEA;;;AAKA;;AAIA;;;AAGA;;;AAKA;;;;;AAOA;;AAEA;;;;;;;;;;;;;;;;AAkBA;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjLA;;;;;;;ACwFA;;;;;;AAMA;AACA;;;;;;;;;AASA;;;;;AAKA;;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChIA;;;;;;;;;;;;;;;;;;AAkBA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;;;AAOA;;;AAGA;;;;;;AAMA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;AAeA;AACA;;;;;AAKA;;;;AAIA;;;AAGA;;;;;;;;;;AAUA;;;AAGA;;;;;;;AAOA;;;;;;;;;AASA;AACA;;;AAGA;AACA;;;;;;;;;ACdA;;;;;;AAMA;;;AAGA;;;;AC0BA;AACA;AAIA;;;;AAIA;;;;AAIA;AAKA;;;;;;;ACxJA;AACA;;;;;;;;AAQA;;;;;;;;;;;;;;AAcA;;;AAGA;;AAIA;AAGA;AACA;;;;;;AAMA;;;;;;;;;ACkGA;AACA;AAIA;;;AAGA;;;;;AAKA;AAKA;;AAIA;;;;;;;;;;;;;;AC4GA;;;AAGA;;;AAGA;;AAIA;AACA;;;;AAMA;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;AC1QA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;AAIA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;;;AAOA;;;AAGA;;;;;;AAMA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;AAeA;AACA;;;;;AAKA;;;;AAIA;;;AAGA;;;;;;;;;;AAUA;;;AAGA;;;;;;;AAOA;;;;;;;;;AASA;AACA;;;AAGA;AACA;;;;;;;;;;;;;ACiSA;;;AAGA;;;AAGA;;AAIA;AACA;;;;AAMA;;AAKA;;AC5dA;;AAEA;;;;;;;AAOA;;AAIA;;;;AAIA;;;;;;;;AAUA;;;;;;;;;;;;;ACkFA;;AAEA;;;;;AAcA;;;;;AAKA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxKA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;AAQA;;;;;;AAQA;;;;;;;;;;;;AAcA;;;AAGA;;;;;AAKA;;;;;;;;;;;;;ACaA;AAGA;;;;;;;AASA;;;;;;;;;;AClEA;AACA;;;;;;;;;;AAUA;;;;;AAKA;;;;;;ACzBA;;AAEA;AAGA;;;AAKA;;;;;ACDA;AAGA;AACA;;AAIA;;;;;ACtEA;AAGA;;;;;ACiCA;AACA;AACA;;;;;;ACyHA;;;AAKA;;;;;;;;;AAWA;;;;;;AAMA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;AACA;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;AC5LA;AACA;;;;;;AAMA;;;;AAIA;;;;;AAKA;;;;;;;;ACmCA;AAGA;AACA;;;;;AAOA;AAMA;AACA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;AAKA;;;AAKA;;;;;;AAQA;;;;;;;ACxLA;;;;;;AAMA;;AAIA;;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAiCA;;;AArBA;;;;AAIA;;AAmBA;;;AAZA;AACA;AACA;AACA;;;;;AAaA;;;;;AClEA;;;ACCA;;;;ACAA;;AAEA;;AAIA;;;AAIA;AACA;AACA;AACA;;;AAGA;AA2BA;;AAtBA;;;AAIA;;;AAoBA;AAbA;AACA;AAEA;;;AAIA;AACA;AAUA","sources":["webpack://@mtes-mct/monitor-ui__root/./.storybook/components/GlobalDecorator.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/MapMenuDialog/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Button.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/IconButton.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/IconBox.tsx","webpack://@mtes-mct/monitor-ui__root/./src/GlobalStyle.ts","webpack://@mtes-mct/monitor-ui__root/./src/theme.ts","webpack://@mtes-mct/monitor-ui__root/./src/OnlyFontGlobalStyle.ts","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/Action.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/Body.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/Title.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dialog/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dropdown/Item.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Dropdown/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/SideMenu/Button.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/SideMenu/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/SingleTag.tsx","webpack://@mtes-mct/monitor-ui__root/./src/symbols/ExclamationPoint.tsx","webpack://@mtes-mct/monitor-ui__root/./src/components/Message.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Legend.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Fieldset.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/FieldError.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Label.tsx","webpack://@mtes-mct/monitor-ui__root/./src/elements/Tag/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Search.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Checkbox.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CheckPicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DatePicker/CalendarPicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/NumberInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/DateInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/RangedTimePicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/TimeInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DatePicker/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/RangeCalendarPicker.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/DateRangePicker/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiCheckbox.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiSelect.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiRadio.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/MultiZoneEditor/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/NumberInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/DDCoordinatesInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/DMDCoordinatesInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/DMSCoordinatesInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/CoordinatesInput/index.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Select.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/Textarea.tsx","webpack://@mtes-mct/monitor-ui__root/./src/fields/TextInput.tsx","webpack://@mtes-mct/monitor-ui__root/./src/tables/SimpleTable.tsx","webpack://@mtes-mct/monitor-ui__root/./src/tables/DataTable/SortingIcon.ts","webpack://@mtes-mct/monitor-ui__root/./src/tables/DataTable/Th.tsx","webpack://@mtes-mct/monitor-ui__root/./src/tables/TableWithSelectableRows/index.tsx"],"sourcesContent":["import { StrictMode } from 'react'\nimport { CustomProvider as RsuiteCustomProvider } from 'rsuite'\nimport rsuiteFrFr from 'rsuite/locales/fr_FR'\nimport { createGlobalStyle, ThemeProvider } from 'styled-components'\n\nimport { GlobalStyle, THEME } from '../../src'\n\nimport type { StoryFn } from '@storybook/react'\n\nconst UntypedGlobalStyle = GlobalStyle as any\nconst UntypedThemeProvider = ThemeProvider as any\n\nconst CustomGlobalStyle: any = createGlobalStyle`\n html,\n body.sb-show-main.sb-main-padded {\n height: 100%;\n padding: 0;\n width: 640px;\n }\n\n code {\n background-color: #1e1e1e;\n color: #ffffff;\n font-size: 12px;\n padding: 2px 6px;\n vertical-align: 1px;\n }\n\n #root {\n height: 100%;\n width: 100%;\n }\n`\n\nexport function GlobalDecorator(Story: StoryFn) {\n return (\n \n \n \n )\n}\n\nexport function GlobalDecoratorWrapper({ children }) {\n return (\n \n \n \n \n\n {children}\n \n \n )\n}\n","import styled from 'styled-components'\n\nimport { IconButton } from '../../elements/IconButton'\n\nconst Container = styled.div`\n background-color: ${p => p.theme.color.white};\n box-shadow: 0px 3px 6px ${p => p.theme.color.slateGray};\n display: flex;\n flex-direction: column;\n margin-right: 6px;\n max-height: 520px;\n width: 320px;\n`\n\nconst Header = styled.div`\n align-items: center;\n background-color: ${p => p.theme.color.charcoal};\n display: flex;\n height: 40px;\n justify-content: space-between;\n padding: 9px 4px 9px 10px;\n`\n\nconst Title = styled.span.attrs(props => ({\n title: String(props.children)\n}))`\n color: ${p => p.theme.color.white};\n font-size: 16px;\n line-height: 22px;\n margin-right: 6px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n`\n\nconst Body = styled.div`\n height: calc(100% - 40px);\n overflow-y: auto;\n padding: 12px;\n`\n\nconst VisibilityButton = styled(IconButton as any)`\n background-color: ${p => p.theme.color.gainsboro};\n`\n\nconst CloseButton = styled(IconButton as any)`\n color: white;\n`\n\nconst Footer = styled.div`\n background: ${p => p.theme.color.white};\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 12px;\n width: 100%;\n z-index: 10;\n`\n\nexport const MapMenuDialog = {\n Body,\n CloseButton,\n Container,\n Footer,\n Header,\n Title,\n VisibilityButton\n}\n","import classnames from 'classnames'\nimport { useCallback, useMemo, type MouseEvent, type ButtonHTMLAttributes, type FunctionComponent } from 'react'\nimport styled from 'styled-components'\n\nimport { Accent, Size } from '../constants'\nimport { type IconProps } from '../types'\nimport { stopMouseEventPropagation } from '../utils/stopMouseEventPropagation'\n\nconst ICON_SIZE: Record = {\n [Size.LARGE]: 20,\n [Size.NORMAL]: 20,\n [Size.SMALL]: 12\n}\n\nexport type ButtonProps = Omit, 'children'> & {\n Icon?: FunctionComponent | undefined\n accent?: Accent | undefined\n children?: string | undefined\n isFullWidth?: boolean | undefined\n size?: Size | undefined\n /** Prevent onClick event propagation. */\n withUnpropagatedClick?: boolean | undefined\n}\nexport function Button({\n accent = Accent.PRIMARY,\n children,\n className,\n Icon,\n isFullWidth = false,\n onClick,\n size = Size.NORMAL,\n type = 'button',\n withUnpropagatedClick = false,\n ...nativeProps\n}: ButtonProps) {\n const handleClick = useCallback(\n (event: MouseEvent) => {\n if (withUnpropagatedClick) {\n stopMouseEventPropagation(event)\n }\n\n if (onClick) {\n onClick(event)\n }\n },\n [onClick, withUnpropagatedClick]\n )\n\n const commonChildren = useMemo(\n () => (\n <>\n {Icon && }\n {children && {children}}\n \n ),\n [children, Icon, size]\n )\n\n const commonProps = useMemo(\n () => ({\n as: StyledButton,\n children: commonChildren,\n className: classnames('Element-Button', className),\n isFullWidth,\n onClick: handleClick,\n size,\n type,\n ...nativeProps\n }),\n [className, commonChildren, handleClick, isFullWidth, nativeProps, size, type]\n )\n\n switch (accent) {\n case Accent.SECONDARY:\n return \n\n case Accent.TERTIARY:\n return \n\n default:\n return \n }\n}\n\nconst FONT_SIZE: Record = {\n [Size.LARGE]: '13px',\n [Size.NORMAL]: '13px',\n [Size.SMALL]: '11px'\n}\nconst PADDING: Record = {\n [Size.LARGE]: '12px',\n [Size.NORMAL]: '6px 12px',\n [Size.SMALL]: '5px 8px 4px'\n}\nconst StyledButton = styled.button<{\n isFullWidth: boolean\n size: Size\n}>`\n align-items: center;\n display: inline-flex;\n font-size: ${p => FONT_SIZE[p.size]};\n justify-content: center;\n max-width: 100%;\n padding: ${p => PADDING[p.size]};\n width: ${p => (p.isFullWidth ? '100%' : 'auto')};\n\n /* SVG Icon Components are wrapped within a
*/\n > div {\n margin-right: 5px;\n }\n`\n\nconst ButtonLabel = styled.span`\n line-height: 1.3846;\n margin-top: -3px;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`\n\nexport const PrimaryButton = styled.button`\n background-color: ${p => p.theme.color.charcoal};\n border: 1px solid ${p => p.theme.color.charcoal};\n color: ${p => p.theme.color.gainsboro};\n\n :hover,\n &._hover {\n background-color: ${p => p.theme.color.blueYonder};\n border: 1px solid ${p => p.theme.color.blueYonder};\n color: ${p => p.theme.color.white};\n }\n\n :active,\n &._active {\n background-color: ${p => p.theme.color.blueGray};\n border: 1px solid ${p => p.theme.color.blueGray};\n color: ${p => p.theme.color.white};\n }\n\n :disabled,\n &._disabled {\n background-color: ${p => p.theme.color.lightGray};\n border: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.cultured};\n }\n`\n\nexport const SecondaryButton = styled.button`\n background-color: transparent;\n border: 1px solid ${p => p.theme.color.charcoal};\n color: ${p => p.theme.color.charcoal};\n\n :hover,\n &._hover {\n background-color: ${p => p.theme.color.blueYonder25};\n border: 1px solid ${p => p.theme.color.blueYonder};\n color: ${p => p.theme.color.blueYonder};\n }\n\n :active,\n &._active {\n background-color: ${p => p.theme.color.blueGray25};\n border: 1px solid ${p => p.theme.color.blueGray};\n color: ${p => p.theme.color.blueGray};\n }\n\n :disabled,\n &._disabled {\n background-color: transparent;\n border: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.lightGray};\n }\n`\n\nexport const TertiaryButton = styled.button`\n background-color: ${p => p.theme.color.white};\n border: 1px solid ${p => p.theme.color.white};\n color: ${p => p.theme.color.charcoal};\n\n :hover,\n &._hover {\n background-color: ${p => p.theme.color.blueYonder25};\n border: 1px solid ${p => p.theme.color.blueYonder25};\n color: ${p => p.theme.color.blueYonder};\n }\n\n :active,\n &._active {\n background-color: ${p => p.theme.color.blueGray25};\n border: 1px solid ${p => p.theme.color.blueGray};\n color: ${p => p.theme.color.blueGray};\n }\n\n :disabled,\n &._disabled {\n background-color: ${p => p.theme.color.white};\n border: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.lightGray};\n }\n`\n","import classnames from 'classnames'\nimport { useMemo, type MouseEvent, type ButtonHTMLAttributes, type FunctionComponent, useCallback } from 'react'\nimport styled, { css } from 'styled-components'\n\nimport { PrimaryButton, SecondaryButton } from './Button'\nimport { Accent, Size } from '../constants'\nimport { type IconProps } from '../types'\nimport { stopMouseEventPropagation } from '../utils/stopMouseEventPropagation'\n\nconst ICON_SIZE_IN_PX: Record = {\n [Size.LARGE]: 26,\n [Size.NORMAL]: 20,\n [Size.SMALL]: 14\n}\n\nexport type IconButtonProps = Omit, 'children'> & {\n Icon: FunctionComponent\n accent?: Accent | undefined\n color?: string | undefined\n /** In pixels, override `size` prop default values. */\n iconSize?: number | undefined\n /** Remove button border and padding. */\n isCompact?: boolean | undefined\n size?: Size | undefined\n /** Prevent onClick event propagation. */\n withUnpropagatedClick?: boolean | undefined\n}\nexport function IconButton({\n accent = Accent.PRIMARY,\n className,\n color,\n Icon,\n iconSize,\n isCompact,\n onClick,\n size = Size.NORMAL,\n type = 'button',\n withUnpropagatedClick = false,\n ...nativeProps\n}: IconButtonProps) {\n const handleClick = useCallback(\n (event: MouseEvent) => {\n if (withUnpropagatedClick) {\n stopMouseEventPropagation(event)\n }\n\n if (onClick) {\n onClick(event)\n }\n },\n [onClick, withUnpropagatedClick]\n )\n\n const commonChildren = useMemo(\n () => ,\n [color, Icon, iconSize, size]\n )\n\n const commonProps = useMemo(\n () => ({\n children: commonChildren,\n className: classnames('Element-IconButton', className),\n isCompact,\n onClick: handleClick,\n size,\n type,\n ...nativeProps\n }),\n [className, commonChildren, handleClick, isCompact, nativeProps, size, type]\n )\n\n switch (accent) {\n case Accent.SECONDARY:\n return \n\n case Accent.TERTIARY:\n return \n\n default:\n return \n }\n}\n\nconst PADDING: Record = {\n [Size.LARGE]: '7px',\n [Size.NORMAL]: '5px',\n [Size.SMALL]: '3px'\n}\n\n// We can't use $-prefixed props here for some reason (maybe because the `as` prop exclude them?).\nconst StyledButton = styled.button<{\n isCompact: boolean | undefined\n size: Size\n}>`\n align-items: center;\n display: flex;\n justify-content: center;\n padding: ${p => (p.isCompact ? 0 : PADDING[p.size])};\n\n ${p =>\n p.isCompact &&\n css`\n border: 0;\n\n :hover,\n &._hover {\n border: 0;\n }\n border: 0;\n\n :active,\n &._active {\n border: 0;\n }\n border: 0;\n\n :disabled,\n &._disabled {\n border: 0;\n }\n `}\n`\n\nconst TertiaryButton = styled.button<{\n isCompact: boolean | undefined\n}>`\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.charcoal};\n\n :hover,\n &._hover {\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.blueYonder};\n }\n\n :active,\n &._active {\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.blueGray};\n }\n\n :disabled,\n &._disabled {\n background-color: transparent;\n border: ${p => (p.isCompact ? 0 : '1px solid transparent')};\n color: ${p => p.theme.color.lightGray};\n }\n`\n","import styled from 'styled-components'\n\nimport type { HTMLAttributes } from 'react'\n\nexport type IconBoxProps = HTMLAttributes & {\n $color?: string | undefined\n /** In pixels */\n $size?: number | undefined\n}\n/**\n * Internal component used to wrap SVG icon components\n */\nexport const IconBox = styled.div.attrs(() => ({\n className: 'Element-IconBox'\n}))`\n display: inline-block;\n color: ${p => p.$color ?? 'inherit'};\n\n > svg {\n display: block;\n height: ${p => p.$size ?? 20}px;\n width: ${p => p.$size ?? 20}px;\n }\n`\n","import { createGlobalStyle } from 'styled-components'\n\n// @ts-ignore\nimport MarianneBold from './assets/fonts/Marianne-Bold.woff2'\n// @ts-ignore\nimport MarianneBoldItalic from './assets/fonts/Marianne-Bold_Italic.woff2'\n// @ts-ignore\nimport MarianneLight from './assets/fonts/Marianne-Light.woff2'\n// @ts-ignore\nimport MarianneLightItalic from './assets/fonts/Marianne-Light_Italic.woff2'\n// @ts-ignore\nimport MarianneMedium from './assets/fonts/Marianne-Medium.woff2'\n// @ts-ignore\nimport MarianneMediumItalic from './assets/fonts/Marianne-Medium_Italic.woff2'\n// @ts-ignore\nimport MarianneRegular from './assets/fonts/Marianne-Regular.woff2'\n// @ts-ignore\nimport MarianneItalic from './assets/fonts/Marianne-Regular_Italic.woff2'\n\nexport const GlobalStyle = createGlobalStyle`\n @font-face {\n font-family: Marianne;\n src: local('Marianne'), local('Marianne-Regular'), url(${MarianneRegular}) format('woff2');\n font-weight: normal;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin'), url(${MarianneLight}) format('woff2');\n font-weight: 300;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Medium'), url(${MarianneMedium}) format('woff2');\n font-weight: 500;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Medium_Italic'), url(${MarianneMediumItalic}) format('woff2');\n font-weight: 500;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin_Italic'), url(${MarianneLightItalic}) format('woff2');\n font-weight: lighter;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Regular_Italic'), url(${MarianneItalic}) format('woff2');\n font-weight: normal;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold'), url(${MarianneBold}) format('woff2');\n font-weight: 700;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold_Italic'), url(${MarianneBoldItalic}) format('woff2');\n font-style: italic;\n font-weight: 700;\n }\n\n body {\n font-family: Marianne, sans-serif;\n font-size: 16px;\n line-height: 1.3846;\n }\n`\n","/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */\n\nimport type { PartialDeep } from 'type-fest'\n\nexport type Theme = typeof THEME\nexport type PartialTheme = PartialDeep\n\nexport const THEME = {\n // https://xd.adobe.com/view/b6d4c472-3fbe-4dec-9f14-38fe03872a3e-e387/screen/b9bdc1ba-5f07-4c4f-bd44-2d38b2c6f663/specs/\n color: {\n /** INTERFACE COLORS */\n\n // Neutral Colors\n gunMetal: '#282F3E',\n // TODO Make that charcoal object 100 & 50\n charcoal: '#3B4559',\n charcoalShadow: 'rgba(59, 69, 89, 0.5)',\n slateGray: '#707785',\n lightGray: '#CCCFD6',\n gainsboro: '#E5E5EB',\n cultured: '#F7F7FA',\n white: '#FFFFFF',\n\n // Accentuation Colors\n blueYonder: '#567A9E',\n blueYonder25: '#D4DDE7',\n blueGray: '#5697D2',\n blueGray25: '#D4E5F4',\n maximumRed: '#E1000F',\n maximumRed15: '#FBD9DB',\n babyBlueEyes: '#99C9FF',\n\n // Notification Colors\n mediumSeaGreen: '#29B361',\n mediumSeaGreen25: '#c9ecd7',\n goldenPoppy: '#FAC11A',\n goldenPoppy25: '#FDF3C3',\n\n /** CONTEXTUAL COLORS */\n\n // Mission status\n yellowGreen: '#8CC800',\n\n // Risk Factor\n cadetGray: '#8E9A9F',\n grullo: '#B89B8C',\n copperRed: '#CF6A4E',\n chineseRed: '#A13112',\n\n // Vessel Track\n darkCornflowerBlue: '#2A4670',\n jungleGreen: '#1C9B7B',\n\n // Beacon Malfunction\n powderBlue: '#9ED7D9',\n wheat: '#EDD6A4',\n opal: '#A5BCC0',\n\n // Regulation Areas\n yaleBlue: '#295375',\n queenBlue: '#367096',\n glaucous: '#6284A6',\n blueNcs: '#3690C0',\n iceberg: '#67A9CF',\n lightSteelBlue: '#9AB4D6',\n lightPeriwinkle: '#CDCFEA',\n aliceBlue: '#EBF0F4',\n lightBlue: '#B9DDE5',\n lightCyan: '#C7EAE5', // deprecated ?\n middleBlueGreen: '#91CFC9', // deprecated ?\n verdigris: '#56B3AB', // deprecated ?\n viridianGreen: '#01A29D', // deprecated ?\n paoloVeroneseGreen: '#21977F', // deprecated ?\n skobeloff: '#01686B', // deprecated ?\n blueSapphire: '#01536A', // deprecated ?\n indigoDye: '#033E54', // deprecated ?\n skyBlue: '#77C1DE',\n frenchBlue: '#2E75AB',\n prussianBlue: '#003E54',\n lightCoral: '#FA8282',\n\n // AMP Zones\n brownSugar: '#B26A53',\n rust: '#B1502F',\n burntSienna: '#D46E49',\n persianOrange: '#D6814F',\n jasper: '#DB503D',\n bittersweet: '#F0755C',\n coral: '#F78A69',\n peach: '#FCB394',\n apricot: '#F0C1A1',\n melon: '#E7A58D',\n paleDogwood: '#F8D7CE',\n seashell: '#FCECE4',\n\n // Custom Zones\n darkGoldenrod: '#A98A0F',\n pear: '#DBE33E',\n jonquil: '#F0CB38',\n earthYellow: '#E6B771',\n ecru: '#BAAB68',\n goldMetallic: '#C5A730',\n mindaro: '#F2F58E'\n }\n}\n","import { createGlobalStyle } from 'styled-components'\n\n// @ts-ignore\nimport MarianneBold from './assets/fonts/Marianne-Bold.woff2'\n// @ts-ignore\nimport MarianneBoldItalic from './assets/fonts/Marianne-Bold_Italic.woff2'\n// @ts-ignore\nimport MarianneLight from './assets/fonts/Marianne-Light.woff2'\n// @ts-ignore\nimport MarianneLightItalic from './assets/fonts/Marianne-Light_Italic.woff2'\n// @ts-ignore\nimport MarianneMedium from './assets/fonts/Marianne-Medium.woff2'\n// @ts-ignore\nimport MarianneMediumItalic from './assets/fonts/Marianne-Medium_Italic.woff2'\n// @ts-ignore\nimport MarianneRegular from './assets/fonts/Marianne-Regular.woff2'\n// @ts-ignore\nimport MarianneItalic from './assets/fonts/Marianne-Regular_Italic.woff2'\n\nexport const OnlyFontGlobalStyle = createGlobalStyle`\n @font-face {\n font-family: Marianne;\n src: local('Marianne'), local('Marianne-Regular'), url(${MarianneRegular}) format('woff2');\n font-weight: normal;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin'), url(${MarianneLight}) format('woff2');\n font-weight: 300;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Medium'), url(${MarianneMedium}) format('woff2');\n font-weight: 500;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Medium_Italic'), url(${MarianneMediumItalic}) format('woff2');\n font-weight: 500;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Thin_Italic'), url(${MarianneLightItalic}) format('woff2');\n font-weight: lighter;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src:local('Marianne-Regular_Italic'), url(${MarianneItalic}) format('woff2');\n font-weight: normal;\n font-style: italic;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold'), url(${MarianneBold}) format('woff2');\n font-weight: 700;\n }\n\n @font-face {\n font-family: Marianne;\n src: local('Marianne-Bold_Italic'), url(${MarianneBoldItalic}) format('woff2');\n font-style: italic;\n font-weight: 700;\n }\n\n body {\n font-family: Marianne, sans-serif;\n }\n`\n","import styled from 'styled-components'\n\nexport const Action = styled.div`\n background-color: ${p => p.theme.color.white};\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n display: flex;\n flex-direction: column-reverse;\n padding: 8px 8px 8px 8px;\n @media (min-width: 740px) {\n align-items: center;\n flex-direction: row;\n justify-content: center;\n padding: 48px 8px 48px 8px;\n }\n\n > button {\n margin-bottom: 2px;\n }\n @media (min-width: 740px) {\n > button {\n margin-bottom: 0;\n margin-right: 2px;\n }\n }\n`\n","import styled from 'styled-components'\n\nexport const Body = styled.div`\n background-color: ${p => p.theme.color.white};\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n display: flex;\n flex-direction: column;\n padding: 8px 8px 8px 8px;\n text-align: center;\n @media (min-width: 740px) {\n padding: 48px 8px 8px 8px;\n text-align: center;\n }\n\n > p {\n color: ${p => p.theme.color.slateGray};\n padding-top: 2px;\n }\n`\n","import styled from 'styled-components'\n\nexport const Title = styled.h4`\n font-size: 125%;\n font-weight: 500;\n line-height: 48px;\n padding-bottom: 2px;\n height: 48px;\n color: ${p => p.theme.color.white};\n background-color: ${p => p.theme.color.charcoal};\n text-align: center;\n`\n","import classnames from 'classnames'\nimport styled from 'styled-components'\n\nimport { Action } from './Action'\nimport { Body } from './Body'\nimport { Title } from './Title'\nimport { stopMouseEventPropagation } from '../../utils/stopMouseEventPropagation'\n\nimport type { HTMLAttributes } from 'react'\n\nexport type DialogProps = HTMLAttributes & {\n isAbsolute?: boolean\n}\nexport function RawDialog({ children, className, isAbsolute = false, ...nativeProps }: DialogProps) {\n const controlledClassName = classnames('Component-Dialog', className)\n\n return (\n \n \n\n {children}\n \n )\n}\n\nexport const Box = styled.div<{\n $isAbsolute: boolean\n}>`\n position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow-y: auto;\n z-index: 9000;\n`\n\nconst Overlay = styled.div<{\n $isAbsolute: boolean\n}>`\n background-color: ${p => p.theme.color.charcoal};\n bottom: 0;\n left: 0;\n opacity: 0.53;\n position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};\n right: 0;\n top: 0;\n z-index: 1;\n`\n\nconst Window = styled.div<{\n $isAbsolute: boolean\n}>`\n border-radius: 2px;\n bottom: 100px;\n box-shadow: 4px;\n max-width: 32rem;\n position: ${p => (p.$isAbsolute ? 'absolute' : 'fixed')};\n width: calc(100% - 2 * 8px);\n z-index: 1;\n @media (min-width: 740px) {\n bottom: auto;\n min-width: 586px;\n }\n`\n\nRawDialog.displayName = 'Dialog'\n\nexport const Dialog = Object.assign(RawDialog, {\n Action,\n Body,\n Title\n})\n","import { useMemo } from 'react'\nimport { Dropdown as RsuiteDropdown } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Accent } from '../../constants'\n\nimport type { IconProps } from '../../types'\nimport type { FunctionComponent } from 'react'\nimport type { DropdownMenuItemProps as RsuiteDropdownMenuItemProps } from 'rsuite'\n\nexport type DropdownItemProps = Omit & {\n Icon?: FunctionComponent\n accent?: Accent | undefined\n}\nexport function Item({ accent, Icon, ...originalProps }: DropdownItemProps) {\n const icon = useMemo(() => (Icon ? : undefined), [Icon])\n const hasIcon = useMemo(() => Boolean(Icon), [Icon])\n\n switch (accent) {\n case Accent.SECONDARY:\n return \n\n default:\n return \n }\n}\n\n// TODO We need to split that into multiple styled components as done in `\n\n <>\n {zones.map((zone, index) => (\n // eslint-disable-next-line react/no-array-index-key\n \n \n {zone[labelPropName]}\n\n {/* TODO Add `Accent.LINK` accent in @mtes-mct/monitor-ui and use it here. */}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}\n centerZone(zone)}>\n \n Centrer sur la carte\n \n \n\n editZone(index, zone)} />\n deleteZone(index)}\n />\n \n ))}\n \n\n {hasError && {controlledError}}\n \n )\n}\n\nconst Row = styled.div`\n align-items: center;\n display: flex;\n margin: 8px 0 0;\n\n > button {\n margin: 0 0 0 8px;\n }\n`\n\nconst ZoneBox = styled.div<{\n $isLight: boolean\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n display: flex;\n flex-grow: 1;\n font-size: 13px;\n line-height: 1.3077; // = 17px\n justify-content: space-between;\n padding: 6px 12px 6px;\n`\n\nconst Link = styled.a`\n align-items: center;\n cursor: pointer;\n display: inline-flex;\n\n > span {\n line-height: 1;\n margin: -2px 0 0 8px;\n }\n`\n","import classnames from 'classnames'\nimport { useCallback, useMemo, useRef, type FocusEvent } from 'react'\nimport { Input, type InputProps } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { Label } from '../elements/Label'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useKey } from '../hooks/useKey'\nimport { usePreventWheelEvent } from '../hooks/usePreventWheelEvent'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { Promisable } from 'type-fest'\n\nexport type NumberInputProps = Omit & {\n error?: string | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: number | undefined) => Promisable) | undefined\n value?: number | undefined\n}\nexport function NumberInput({\n className,\n error,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isUndefinedWhenDisabled = false,\n label,\n onBlur,\n onChange,\n onFocus,\n style,\n value,\n ...originalProps\n}: NumberInputProps) {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef(null)\n\n const controlledClassname = useMemo(() => classnames('Field-NumberInput', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([originalProps.disabled, originalProps.name])\n\n const preventWheelEvent = usePreventWheelEvent(inputRef)\n\n const handleChange = useCallback(\n (nextValue: string) => {\n if (!onChange) {\n return\n }\n\n const normalizedNextValueAsString = nextValue && nextValue.length ? nextValue : undefined\n const nextValueAsNumber = Number(normalizedNextValueAsString)\n const normalizedNextValue = !Number.isNaN(nextValueAsNumber) ? nextValueAsNumber : undefined\n\n onChange(normalizedNextValue)\n },\n [onChange]\n )\n\n const handleBlur = useCallback(\n (event: FocusEvent) => {\n event.target.removeEventListener('wheel', preventWheelEvent)\n\n if (onBlur) {\n onBlur(event)\n }\n },\n [onBlur, preventWheelEvent]\n )\n\n const handleFocus = useCallback(\n (event: FocusEvent) => {\n event.target.addEventListener('wheel', preventWheelEvent)\n\n if (onFocus) {\n onFocus(event)\n }\n },\n [onFocus, preventWheelEvent]\n )\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange)\n\n return (\n \n \n {label}\n \n\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst StyledInput = styled(Input as any)<{\n $hasError: boolean\n $isLight: boolean\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};\n border-radius: 0;\n font-size: 13px;\n /* TODO It should be 18px but computed line-height is stuck to min. 18.5px. Investigate that. */\n line-height: 19px;\n padding: 3px 8px 6px;\n vertical-align: center;\n width: 100%;\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n outline: 0;\n }\n`\n","import { useMemo, useRef, useState } from 'react'\nimport styled from 'styled-components'\nimport { useDebouncedCallback } from 'use-debounce'\n\nimport { THEME } from '../../theme'\nimport { isNumeric } from '../../utils/isNumeric'\n\nimport type { Coordinates } from '../../types'\n\ntype DDCoordinatesInputProps = {\n coordinates: Coordinates | undefined\n disabled: boolean | undefined\n isLight: boolean | undefined\n onChange: (nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void\n}\n// TODO This field should return undefined when cleared (i.e.: Select all & Backspace/Delete)\nexport function DDCoordinatesInput({\n coordinates,\n disabled = false,\n isLight = false,\n onChange\n}: DDCoordinatesInputProps) {\n const latitudeInputRef = useRef()\n const longitudeInputRef = useRef()\n\n const [latitudeError, setLatitudeError] = useState('')\n const [longitudeError, setLongitudeError] = useState('')\n\n const defaultValue = useMemo(() => {\n if (!coordinates) {\n return undefined\n }\n\n const [latitude, longitude] = coordinates\n\n if (isNumeric(latitude) && isNumeric(longitude)) {\n return {\n latitude: Number(latitude),\n longitude: Number(longitude)\n }\n }\n\n return {\n latitude: undefined,\n longitude: undefined\n }\n }, [coordinates])\n\n const handleChange = useDebouncedCallback((nextCoordinates: [number, number] | undefined) => {\n if (!latitudeInputRef.current || !longitudeInputRef.current) {\n return\n }\n\n const latitudeAsString = latitudeInputRef.current.value\n const longitudeAsString = longitudeInputRef.current.value\n\n setLongitudeError('')\n setLatitudeError('')\n\n if (!isNumeric(latitudeAsString)) {\n setLatitudeError('Champ Latitude incorrect')\n\n return\n }\n\n if (!isNumeric(longitudeAsString)) {\n setLongitudeError('Champ Longitude incorrect')\n\n return\n }\n\n const latitude = Number(latitudeAsString)\n const longitude = Number(longitudeAsString)\n\n onChange([latitude, longitude], nextCoordinates)\n }, 500)\n\n return (\n \n handleChange(coordinates)}\n placeholder=\"Latitude\"\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,\n border: latitudeError ? '1px solid red' : undefined\n }}\n />\n handleChange(coordinates)}\n placeholder=\"Longitude\"\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,\n border: longitudeError ? '1px solid red' : undefined\n }}\n />\n (DD)\n {latitudeError}\n {longitudeError}\n \n )\n}\n\nconst DDInput = styled.input`\n margin-right: 5px !important;\n width: 100px;\n`\n\nconst CoordinatesType = styled.span`\n margin-left: 7px;\n color: ${p => p.theme.color.slateGray};\n`\n\nconst Error = styled.span`\n color: red;\n display: block;\n`\n\nconst Box = styled.div`\n font-size: 13px;\n text-align: left;\n`\n","import { useEffect, useState } from 'react'\nimport { dmsToDecimal } from 'react-coordinate-input'\nimport { IMaskInput } from 'react-imask'\nimport styled from 'styled-components'\n\nimport { CoordinatesFormat, WSG84_PROJECTION } from '../../constants'\nimport { THEME } from '../../theme'\nimport { getCoordinates } from '../../utils/coordinates'\nimport { isNumeric } from '../../utils/isNumeric'\n\nimport type { Coordinates } from '../../types'\n\n// TODO Remove that once the fix is added and released.\n// Open issue: https://github.com/uNmAnNeR/imaskjs/issues/761\nconst UntypedIMaskInput: any = IMaskInput\n\ntype DMDCoordinatesInputProps = {\n coordinates: Coordinates | undefined\n coordinatesFormat: CoordinatesFormat\n disabled: boolean | undefined\n isLight: boolean | undefined\n onChange: (nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void\n}\n// TODO This field should return undefined when cleared (i.e.: Select all & Backspace/Delete)\nexport function DMDCoordinatesInput({\n coordinates,\n coordinatesFormat,\n disabled = false,\n isLight,\n onChange\n}: DMDCoordinatesInputProps) {\n const [error, setError] = useState('')\n const [value, setValue] = useState('')\n\n useEffect(() => {\n if (coordinates?.length && coordinatesFormat) {\n const nextValue = getCoordinates(\n [coordinates[1], coordinates[0]],\n WSG84_PROJECTION,\n CoordinatesFormat.DEGREES_MINUTES_DECIMALS\n )\n .map(coordinate => coordinate.replace(/[°′. ]/g, ''))\n .join('')\n\n setValue(nextValue)\n } else {\n setValue('')\n }\n }, [coordinates, coordinatesFormat])\n\n function completeCoordinates(mask) {\n setError('')\n\n // eslint-disable-next-line no-underscore-dangle\n const latitude = mask._unmaskedValue.substring(0, 7)\n // eslint-disable-next-line no-underscore-dangle\n const longitude = mask._unmaskedValue.substring(7, mask._unmaskedValue.length)\n const NS = latitude[latitude.length - 1].toUpperCase()\n if (!['N', 'S'].includes(NS)) {\n setError('La latitude doit être N ou S')\n\n return\n }\n const latitudeDegrees = parseInt(latitude.substring(0, 2), 10)\n if (latitudeDegrees < 0 || latitudeDegrees > 90) {\n setError('La latitude doit être comprise entre 0 et 90°')\n\n return\n }\n const latitudeMinutes = parseInt(latitude.substring(2, 4), 10)\n const latitudeSeconds = parseInt(latitude.substring(4, 6), 10)\n\n const EW = longitude[longitude.length - 1].toUpperCase()\n if (!['E', 'W'].includes(EW)) {\n setError('La longitude doit être E ou W')\n\n return\n }\n const longitudeDegrees = parseInt(longitude.substring(0, 3), 10)\n if (longitudeDegrees < 0 || longitudeDegrees > 180) {\n setError('La longitude doit être comprise entre 0 et 180°')\n\n return\n }\n const longitudeMinutes = parseInt(longitude.substring(3, 5), 10)\n const longitudeSeconds = parseInt(longitude.substring(5, 7), 10)\n\n const dLatitude = dmsToDecimal(latitudeDegrees, latitudeMinutes + 10 ** -2 * latitudeSeconds, 0, NS, 6)\n const dLongitude = dmsToDecimal(longitudeDegrees, longitudeMinutes + 10 ** -2 * longitudeSeconds, 0, EW, 6)\n\n if (isNumeric(dLatitude) && isNumeric(dLongitude)) {\n onChange([dLatitude as number, dLongitude as number], coordinates)\n } else {\n setError('Format lat/long invalide')\n }\n }\n\n return (\n \n setValue(mask.value)}\n onComplete={(_, mask) => completeCoordinates(mask)}\n placeholder=\"__° __.___′ _ ___° __.___′\"\n radix=\".\"\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,\n border: error ? '1px solid red' : undefined\n }}\n // TODO Use `defaultValue` here.\n value={value}\n />\n (DMD)\n {error}\n \n )\n}\n\nconst CoordinatesType = styled.span`\n margin-left: 7px;\n color: ${p => p.theme.color.slateGray};\n`\n\nconst Error = styled.span`\n color: ${p => p.theme.color.maximumRed};\n display: inline-block;\n`\n\nconst Box = styled.div`\n font-size: 13px;\n text-align: left;\n`\n","import { isEmpty } from 'ramda'\nimport { useCallback, useMemo } from 'react'\nimport CoordinateInput from 'react-coordinate-input'\nimport styled from 'styled-components'\n\nimport { THEME } from '../../theme'\n\nimport type { CoordinatesFormat } from '../../constants'\nimport type { Coordinates } from '../../types'\n\ntype DMSCoordinatesInputProps = {\n coordinates: Coordinates | undefined\n coordinatesFormat: CoordinatesFormat\n disabled: boolean | undefined\n isLight: boolean | undefined\n onChange: (nextCoordinates: Coordinates | undefined, coordinates: Coordinates | undefined) => void\n}\nexport function DMSCoordinatesInput({\n coordinates,\n coordinatesFormat,\n disabled = false,\n isLight,\n onChange\n}: DMSCoordinatesInputProps) {\n /** Convert the coordinates to the [latitude, longitude] string format */\n const defaultValue = useMemo(() => {\n if (!coordinates?.length || !coordinatesFormat) {\n return ''\n }\n\n return coordinates?.join(', ') || ''\n }, [coordinates, coordinatesFormat])\n\n const update = useCallback(\n nextCoordinates => {\n const normalizedNextCoordinates = !isEmpty(nextCoordinates) ? nextCoordinates : undefined\n\n onChange(normalizedNextCoordinates, coordinates)\n },\n [coordinates, onChange]\n )\n\n return (\n \n update(dd)}\n style={{\n backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro\n }}\n // TODO Use `defaultValue` here.\n value={defaultValue}\n />\n (DMS)\n \n )\n}\n\nconst CoordinatesType = styled.span`\n margin-left: 7px;\n color: ${p => p.theme.color.slateGray};\n`\n\nconst Box = styled.div`\n font-size: 13px;\n text-align: left;\n`\n","import classnames from 'classnames'\nimport { noop } from 'lodash/fp'\nimport { useCallback, useMemo } from 'react'\nimport styled from 'styled-components'\n\nimport { DDCoordinatesInput } from './DDCoordinatesInput'\nimport { DMDCoordinatesInput } from './DMDCoordinatesInput'\nimport { DMSCoordinatesInput } from './DMSCoordinatesInput'\nimport { CoordinatesFormat } from '../../constants'\nimport { FieldError } from '../../elements/FieldError'\nimport { Fieldset } from '../../elements/Fieldset'\nimport { useFieldUndefineEffect } from '../../hooks/useFieldUndefineEffect'\nimport { normalizeString } from '../../utils/normalizeString'\n\nimport type { FieldsetProps } from '../../elements/Fieldset'\nimport type { Coordinates } from '../../types'\nimport type { Promisable } from 'type-fest'\n\nexport type CoordinatesInputProps = FieldsetProps & {\n coordinatesFormat: CoordinatesFormat\n defaultValue?: Coordinates | undefined\n disabled?: boolean | undefined\n error?: string | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n label: string\n onChange?:\n | ((nextCoordinates: Coordinates | undefined, coordinates: Coordinates | undefined) => Promisable)\n | undefined\n}\nexport function CoordinatesInput({\n className,\n coordinatesFormat,\n defaultValue,\n error,\n isLabelHidden = false,\n isLight = false,\n label,\n onChange = noop,\n ...nativeProps\n}: CoordinatesInputProps) {\n const controlledClassName = classnames('Field-CoordinatesInput', className)\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n\n const getCoordinatesInput = useCallback(() => {\n switch (coordinatesFormat) {\n case CoordinatesFormat.DEGREES_MINUTES_SECONDS:\n return (\n \n )\n\n case CoordinatesFormat.DEGREES_MINUTES_DECIMALS:\n return (\n \n )\n\n case CoordinatesFormat.DECIMAL_DEGREES:\n return (\n \n )\n\n default:\n return undefined\n }\n }, [defaultValue, nativeProps.disabled, onChange, coordinatesFormat, isLight])\n\n // TODO We must add a `handleDisable()` callback here to effectively empty the inputs when disabling this field.\n useFieldUndefineEffect(nativeProps.disabled, onChange /* , handleDisable */)\n\n return (\n \n {getCoordinatesInput()}\n\n {hasError && {controlledError}}\n \n )\n}\n\nconst StyledFieldset = styled(Fieldset as any)`\n input {\n background-color: ${p => (p.isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: ${p => (p.isLight ? `1px solid ${p.theme.color.lightGray}` : 'none')};\n color: ${p => p.theme.color.gunMetal};\n height: 33px;\n padding: 7px 11px;\n }\n`\n","import classnames from 'classnames'\nimport { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent, type ReactNode } from 'react'\nimport { SelectPicker, type SelectPickerProps } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { Label } from '../elements/Label'\nimport { useClickOutsideEffect } from '../hooks/useClickOutsideEffect'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useForceUpdate } from '../hooks/useForceUpdate'\nimport { useKey } from '../hooks/useKey'\nimport { type CustomSearch } from '../libs/CustomSearch'\nimport { type Option, type OptionAsRsuiteItemDataType, type OptionValueType } from '../types'\nimport { getRsuiteDataFromOptions } from '../utils/getRsuiteDataFromOptions'\nimport { getRsuiteValueFromOptionValue } from '../utils/getRsuiteValueFromOptionValue'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { Promisable } from 'type-fest'\n\nexport type SelectProps = Omit<\n SelectPickerProps,\n | 'as'\n | 'container'\n | 'data'\n | 'defaultValue'\n | 'id'\n | 'onChange'\n | 'open'\n | 'renderMenuItem'\n | 'renderValue'\n | 'value'\n | 'valueKey'\n> & {\n /** Used to pass something else than `window.document` as a base container to attach global events listeners. */\n baseContainer?: Document | HTMLDivElement | null | undefined\n customSearch?: CustomSearch> | undefined\n /** Minimum search query length required to trigger custom search filtering. */\n customSearchMinQueryLength?: number | undefined\n error?: string | undefined\n isCleanable?: boolean | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: OptionValue | undefined) => Promisable) | undefined\n optionValueKey?: keyof OptionValue | undefined\n options: Option[]\n value?: OptionValue | undefined\n}\nexport function Select({\n baseContainer,\n className,\n customSearch,\n customSearchMinQueryLength = 1,\n disabled = false,\n error,\n isCleanable = true,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isUndefinedWhenDisabled = false,\n label,\n onChange,\n options,\n optionValueKey,\n searchable = false,\n style,\n value,\n ...originalProps\n}: SelectProps) {\n // eslint-disable-next-line no-null/no-null\n const boxRef = useRef(null)\n /** Instance of `CustomSearch` */\n const customSearchRef = useRef(customSearch)\n\n const { forceUpdate } = useForceUpdate()\n\n const controlledClassname = useMemo(() => classnames('Field-Select', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const rsuiteData = useMemo(() => getRsuiteDataFromOptions(options, optionValueKey), [options, optionValueKey])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([disabled, originalProps.name, value])\n const selectedRsuiteValue = useMemo(\n () => getRsuiteValueFromOptionValue(value, optionValueKey),\n [value, optionValueKey]\n )\n\n // Only used when `customSearch` prop is set\n const [controlledRsuiteData, setControlledRsuiteData] = useState(customSearch ? rsuiteData : undefined)\n const [isOpen, setIsOpen] = useState(false)\n\n const close = useCallback(() => {\n setIsOpen(false)\n }, [])\n\n const handleClean = useCallback(() => {\n if (!onChange) {\n return\n }\n\n onChange(undefined)\n }, [onChange])\n\n const handleSearch = useCallback(\n (nextQuery: string) => {\n if (!customSearchRef.current || nextQuery.trim().length < customSearchMinQueryLength) {\n setControlledRsuiteData(rsuiteData)\n\n return\n }\n\n const nextControlledRsuiteData =\n nextQuery.trim().length >= customSearchMinQueryLength\n ? getRsuiteDataFromOptions(customSearchRef.current.find(nextQuery), optionValueKey)\n : rsuiteData\n\n setControlledRsuiteData(nextControlledRsuiteData)\n },\n [customSearchMinQueryLength, optionValueKey, rsuiteData]\n )\n\n const handleSelect = useCallback(\n (_: string, selectedItem: OptionAsRsuiteItemDataType) => {\n close()\n\n if (onChange) {\n onChange(selectedItem.optionValue)\n }\n },\n [close, onChange]\n )\n\n const renderMenuItem = useCallback((node: ReactNode) => {String(node)}, [])\n\n const toggle = useCallback(\n (event: MouseEvent) => {\n if (disabled) {\n return\n }\n let targetElement = event.target as HTMLElement\n\n if (targetElement.tagName === 'path') {\n if (targetElement.parentElement) {\n targetElement = targetElement.parentElement\n }\n }\n\n if (\n targetElement.classList.contains('rs-picker-toggle') ||\n targetElement.classList.contains('rs-picker-toggle-value') ||\n targetElement.classList.contains('rs-stack-item') ||\n targetElement.classList.contains('rs-picker-toggle-caret') ||\n targetElement.classList.contains('rs-picker-toggle-placeholder')\n ) {\n setIsOpen(!isOpen)\n }\n },\n [isOpen, disabled]\n )\n\n const disabledItemValues = useMemo(\n () => (controlledRsuiteData || rsuiteData).filter(option => option.isDisabled).map(option => option.value),\n [controlledRsuiteData, rsuiteData]\n )\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && disabled, onChange)\n\n useClickOutsideEffect(boxRef, close, baseContainer)\n\n useEffect(() => {\n forceUpdate()\n }, [forceUpdate])\n\n return (\n \n \n\n \n {boxRef.current && (\n true : undefined) as any}\n value={selectedRsuiteValue}\n {...originalProps}\n />\n )}\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst StyledSelectPicker = styled(SelectPicker as any)<{\n $isLight: boolean\n}>`\n > .rs-picker-toggle {\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)} !important;\n border: 0;\n }\n`\n\nconst Box = styled.div<{\n $hasError: boolean\n}>`\n position: relative;\n user-select: none;\n width: 100%;\n\n > .rs-picker-select {\n width: 100%;\n\n > .rs-picker-toggle {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)} !important;\n font-size: 13px;\n line-height: 1.3846;\n padding: 4px 40px 6px 8px;\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n }\n\n > .rs-stack {\n > .rs-stack-item {\n > .rs-picker-toggle-placeholder {\n font-size: 13px;\n line-height: 1.3846;\n }\n\n > .rs-picker-toggle-clean.rs-btn-close {\n top: 4px !important;\n }\n\n > svg {\n height: 18px;\n margin-top: -2px;\n }\n }\n }\n }\n }\n\n > .rs-picker-menu {\n max-width: 100%;\n\n > .rs-picker-search-bar {\n > .rs-picker-search-bar-input {\n background-color: ${p => p.theme.color.white};\n border: solid 1px ${p => p.theme.color.lightGray};\n border-radius: 0;\n font-size: 13px;\n padding: 4px 8px 6px 8px;\n }\n\n > svg {\n color: ${p => p.theme.color.lightGray};\n top: 11px;\n }\n }\n\n > .rs-picker-select-menu {\n > div[role='option'] {\n > .rs-picker-select-menu-item {\n font-size: 13px;\n line-height: 1.3846;\n overflow: hidden;\n padding: 6px 12px 10px 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n }\n }\n`\n","import classnames from 'classnames'\nimport { useCallback, useMemo, useRef } from 'react'\nimport { Input } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { Label } from '../elements/Label'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useKey } from '../hooks/useKey'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { MutableRefObject, TextareaHTMLAttributes } from 'react'\nimport type { Promisable } from 'type-fest'\n\nexport type TextareaProps = Omit<\n TextareaHTMLAttributes,\n 'defaultValue' | 'id' | 'onChange' | 'value'\n> & {\n error?: string | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: string | undefined) => Promisable) | undefined\n value?: string | undefined\n}\nexport function Textarea({\n className,\n error,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isUndefinedWhenDisabled = false,\n label,\n onChange,\n rows = 3,\n style,\n value,\n ...originalProps\n}: TextareaProps) {\n const inputRef = useRef() as MutableRefObject\n\n const controlledClassname = useMemo(() => classnames('Field-Textarea', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([originalProps.disabled, originalProps.name])\n\n const handleChange = useCallback(() => {\n if (!onChange) {\n return\n }\n\n const nextValue = inputRef.current.value\n const normalizedNextValue = nextValue.trim().length ? nextValue : undefined\n\n onChange(normalizedNextValue)\n }, [onChange])\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange)\n\n return (\n \n \n {label}\n \n\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst StyledInput = styled(Input as any)<{\n $hasError: boolean\n $isLight: boolean\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};\n font-size: 13px;\n padding: 7px 11px;\n width: 100%;\n\n ::placeholder {\n color: ${p => (p.$isLight ? p.theme.color.slateGray : p.theme.color.slateGray)};\n }\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n outline: 0;\n }\n`\n","import classnames from 'classnames'\nimport { type FunctionComponent, useCallback, useMemo } from 'react'\nimport { Input } from 'rsuite'\nimport styled from 'styled-components'\n\nimport { Accent, Size } from '../constants'\nimport { Field } from '../elements/Field'\nimport { FieldError } from '../elements/FieldError'\nimport { IconButton } from '../elements/IconButton'\nimport { Label } from '../elements/Label'\nimport { useFieldUndefineEffect } from '../hooks/useFieldUndefineEffect'\nimport { useKey } from '../hooks/useKey'\nimport { Close, Search } from '../icons'\nimport { THEME } from '../theme'\nimport { normalizeString } from '../utils/normalizeString'\n\nimport type { IconProps } from '../types'\nimport type { InputProps } from 'rsuite'\nimport type { Promisable } from 'type-fest'\n\nexport type TextInputProps = Omit & {\n Icon?: FunctionComponent | undefined\n error?: string | undefined\n isErrorMessageHidden?: boolean | undefined\n isLabelHidden?: boolean | undefined\n isLight?: boolean | undefined\n isSearchInput?: boolean\n isUndefinedWhenDisabled?: boolean | undefined\n label: string\n name: string\n onChange?: ((nextValue: string | undefined) => Promisable) | undefined\n size?: Size | undefined\n value?: string | undefined\n}\nexport function TextInput({\n className,\n error,\n Icon,\n isErrorMessageHidden = false,\n isLabelHidden = false,\n isLight = false,\n isSearchInput = false,\n isUndefinedWhenDisabled = false,\n label,\n onChange,\n size = Size.NORMAL,\n style,\n type = 'text',\n value,\n ...originalProps\n}: TextInputProps) {\n const controlledClassname = useMemo(() => classnames('Field-TextInput', className), [className])\n const controlledError = useMemo(() => normalizeString(error), [error])\n const hasError = useMemo(() => Boolean(controlledError), [controlledError])\n const key = useKey([originalProps.disabled, originalProps.name])\n\n const clean = useCallback(() => {\n if (!onChange) {\n return\n }\n onChange(undefined)\n }, [onChange])\n\n const handleChange = useCallback(\n (nextValue: string | null) => {\n if (!onChange) {\n return\n }\n\n const normalizedNextValue = nextValue && nextValue.trim().length ? nextValue : undefined\n\n onChange(normalizedNextValue)\n },\n [onChange]\n )\n\n useFieldUndefineEffect(isUndefinedWhenDisabled && originalProps.disabled, onChange)\n\n return (\n \n \n {label}\n \n\n \n \n {isSearchInput && !Icon && (\n \n {value && (\n <>\n \n \n \n )}\n\n \n \n )}\n\n {Icon && }\n \n\n {!isErrorMessageHidden && hasError && {controlledError}}\n \n )\n}\n\nconst PADDING: Record = {\n [Size.LARGE]: '8px 16px 11px',\n [Size.NORMAL]: '3px 8px 6px',\n [Size.SMALL]: '3px 8px 6px'\n}\nconst PADDING_WITH_ICON: Record = {\n [Size.LARGE]: '8px 40px 11px 16px',\n [Size.NORMAL]: '3px 38px 6px 8px',\n [Size.SMALL]: '3px 38px 6px 8px'\n}\n\nconst IconsContainer = styled.div<{\n $size: Size\n}>`\n align-items: center;\n display: flex;\n position: absolute;\n right: 5px;\n top: ${p => (p.$size === Size.LARGE ? '10px' : '5px')};\n`\n\nconst Separator = styled.div`\n border-right: 1px solid ${p => p.theme.color.lightGray};\n height: 20px;\n margin-left: 4px;\n margin-right: 6px;\n padding-top: 3px;\n`\n\nconst StyledInput = styled(Input as any)<{\n $hasError: boolean\n $hasIcon: boolean\n $isLight: boolean\n $size: Size\n}>`\n background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.gainsboro)};\n border-radius: 0;\n font-size: 13px;\n /* TODO It should be 18px but computed line-height is stuck to min. 18.5px. Investigate that. */\n line-height: 19px;\n padding: ${p => (p.$hasIcon ? PADDING_WITH_ICON[p.$size] : PADDING[p.$size])};\n vertical-align: center;\n width: 100%;\n\n ::placeholder {\n color: ${p => (p.$isLight ? p.theme.color.slateGray : p.theme.color.slateGray)};\n }\n\n :hover {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueYonder)} !important;\n }\n\n :active,\n :focus {\n border: solid 1px ${p => (p.$hasError ? p.theme.color.maximumRed : p.theme.color.blueGray)} !important;\n outline: 0;\n }\n`\n\nconst InputBox = styled.div<{\n $size: Size\n}>`\n position: relative;\n width: 100%;\n > .Element-IconBox {\n position: absolute;\n right: 10px;\n top: ${p => (p.$size === Size.LARGE ? '10px' : '5px')};\n }\n`\n","import classnames from 'classnames'\nimport styled from 'styled-components'\n\nimport type { TableHTMLAttributes } from 'react'\n\nconst Table = styled.table.attrs>(props => ({\n className: classnames('Table-SimpleTable', props.className)\n}))`\n width: 100%;\n table-layout: auto;\n overflow: auto;\n border-collapse: separate;\n`\nconst Head = styled.thead`\n position: sticky;\n top: 0;\n z-index: 1;\n\n th:first-child {\n border-left: 1px solid ${p => p.theme.color.lightGray};\n }\n`\n\nconst SortContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: default;\n\n &.cursor-pointer {\n cursor: pointer;\n }\n`\nconst Th = styled.th`\n background-color: ${p => p.theme.color.gainsboro};\n border-top: 1px solid ${p => p.theme.color.lightGray};\n border-bottom: 1px solid ${p => p.theme.color.lightGray};\n border-right: 1px solid ${p => p.theme.color.lightGray};\n color: ${p => p.theme.color.slateGray};\n font-size: 13px;\n font-weight: 500;\n padding: 10px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`\n\nconst BodyTr = styled.tr`\n :hover {\n > td {\n background-color: ${p => p.theme.color.blueYonder25};\n }\n }\n td:first-child {\n border-left: 1px solid ${p => p.theme.color.lightGray};\n }\n`\n\nconst Td = styled.td<{ $isCenter?: boolean }>`\n font-size: 13px;\n font-weight: 500;\n color: ${p => p.theme.color.gunMetal};\n text-align: ${p => (p.$isCenter ? 'center' : 'left')};\n border-bottom: 1px solid ${p => p.theme.color.lightGray};\n border-right: 1px solid ${p => p.theme.color.lightGray};\n overflow: hidden;\n padding: 10px;\n text-overflow: ellipsis;\n white-space: nowrap;\n`\n\nexport const SimpleTable = {\n BodyTr,\n Head,\n SortContainer,\n Table,\n Td,\n Th\n}\n","import styled from 'styled-components'\n\nimport { Chevron } from '../../icons'\n\nexport const SortingIcon = styled(Chevron as any)<{\n $isDescending?: boolean\n}>`\n cursor: pointer;\n height: 16px;\n margin-right: 8px;\n margin-top: 0px;\n transform: ${props => (!props.$isDescending ? 'rotate(0deg)' : 'rotate(-180deg)')};\n transition: all 0.5s;\n width: 16px;\n`\n","import { flexRender, type Header } from '@tanstack/react-table'\n\nimport { SortingIcon } from './SortingIcon'\nimport { SortingArrows } from '../../icons'\nimport { SimpleTable } from '../SimpleTable'\n\nimport type { ReactNode } from 'react'\n\nexport type ThProps = {\n children?: ReactNode\n header: Header\n}\nexport function Th({ children, header }: ThProps) {\n const controlledChildren =\n children || !header.isPlaceholder ? (\n \n {flexRender(header.column.columnDef.header, header.getContext())}\n\n {header.column.getCanSort() &&\n ({\n asc: ,\n desc: \n }[header.column.getIsSorted() as string] ?? )}\n \n ) : undefined\n\n return (\n \n {controlledChildren}\n \n )\n}\n","import styled from 'styled-components'\n\nimport { RowCheckbox } from './RowCheckbox'\nimport { SimpleTable } from '../SimpleTable'\n\nexport { RowCheckbox }\n\nconst Table = styled(SimpleTable.Table)`\n border-collapse: separate;\n border-spacing: 0 5px;\n table-layout: fixed;\n`\nconst Head = styled(SimpleTable.Head)`\n th:last-child {\n border-right: 1px solid ${p => p.theme.color.lightGray};\n }\n`\n\nconst SortContainer = styled(SimpleTable.SortContainer)`\n justify-content: start;\n gap: 8px;\n`\nconst Th = styled(SimpleTable.Th)<{ $width: number }>`\n background-color: ${p => p.theme.color.white};\n border-top: 1px solid ${p => p.theme.color.lightGray};\n border-bottom: 1px solid ${p => p.theme.color.lightGray};\n border-right: none;\n padding: 2px 16px;\n width: ${p => p.$width}px;\n`\n\nconst BodyTr = styled(SimpleTable.BodyTr)<{ $isHighlighted?: boolean }>`\n td:first-child {\n border-left: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n }\n td:last-child {\n border-right: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n overflow: visible;\n }\n`\n\nconst Td = styled(SimpleTable.Td)<{ $hasRightBorder: boolean; $isHighlighted?: boolean; $width: number }>`\n background-color: ${p => p.theme.color.cultured};\n border-top: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n border-bottom: ${p =>\n p.$isHighlighted ? `2px solid ${p.theme.color.blueGray}` : `1px solid ${p.theme.color.lightGray}`};\n border-right: none;\n padding: 4px 16px;\n border-right: ${p => (p.$hasRightBorder ? `1px solid ${p.theme.color.lightGray}` : '')};\n width: ${p => p.$width}px;\n`\n\nexport const TableWithSelectableRows = {\n BodyTr,\n Head,\n RowCheckbox,\n SortContainer,\n Table,\n Td,\n Th\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/project.json b/project.json index 9591a6f16..c73226f33 100644 --- a/project.json +++ b/project.json @@ -1 +1 @@ -{"generatedAt":1705476526449,"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"yarn","version":"4.0.2"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-webpack5","options":{}},"builder":"@storybook/builder-webpack5","renderer":"@storybook/react","storybookVersion":"7.3.2","storybookVersionSpecifier":"7.3.2","language":"typescript","storybookPackages":{"@storybook/react":{"version":"7.3.2"},"@storybook/react-webpack5":{"version":"7.0.27"},"@storybook/test-runner":{"version":"0.13.0"},"@storybook/testing-react":{"version":"2.0.1"},"storybook":{"version":"7.5.3"}},"addons":{"@storybook/addon-essentials":{"version":"7.5.3"},"storybook-addon-performance":{"version":null},"@storybook/addon-a11y":{"version":"7.0.27"},"chromatic":{"version":null,"versionSpecifier":"6.19.9"}}} +{"generatedAt":1705485316137,"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"yarn","version":"4.0.2"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-webpack5","options":{}},"builder":"@storybook/builder-webpack5","renderer":"@storybook/react","storybookVersion":"7.3.2","storybookVersionSpecifier":"7.3.2","language":"typescript","storybookPackages":{"@storybook/react":{"version":"7.3.2"},"@storybook/react-webpack5":{"version":"7.0.27"},"@storybook/test-runner":{"version":"0.13.0"},"@storybook/testing-react":{"version":"2.0.1"},"storybook":{"version":"7.5.3"}},"addons":{"@storybook/addon-essentials":{"version":"7.5.3"},"storybook-addon-performance":{"version":null},"@storybook/addon-a11y":{"version":"7.0.27"},"chromatic":{"version":null,"versionSpecifier":"6.19.9"}}} diff --git a/runtime~main.bc6254c6.iframe.bundle.js b/runtime~main.8f374b57.iframe.bundle.js similarity index 98% rename from runtime~main.bc6254c6.iframe.bundle.js rename to runtime~main.8f374b57.iframe.bundle.js index df534c17b..32365e4fe 100644 --- a/runtime~main.bc6254c6.iframe.bundle.js +++ b/runtime~main.8f374b57.iframe.bundle.js @@ -1 +1 @@ -(()=>{"use strict";var deferred,leafPrototypes,getProto,inProgress,__webpack_modules__={},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.amdO={},deferred=[],__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(!chunkIds){var notFulfilled=1/0;for(i=0;i=priority)&&Object.keys(__webpack_require__.O).every((key=>__webpack_require__.O[key](chunkIds[j])))?chunkIds.splice(j--,1):(fulfilled=!1,priority0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority]},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,__webpack_require__.t=function(value,mode){if(1&mode&&(value=this(value)),8&mode)return value;if("object"==typeof value&&value){if(4&mode&&value.__esModule)return value;if(16&mode&&"function"==typeof value.then)return value}var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=2&mode&&value;"object"==typeof current&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach((key=>def[key]=()=>value[key]));return def.default=()=>value,__webpack_require__.d(ns,def),ns},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce(((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises)),[])),__webpack_require__.u=chunkId=>(({231:"fields-MultiSelect-MultiSelectWithCustomSearch-stories",270:"formiks-FormikCheckbox-stories",301:"formiks-FormikMultiSelect-stories",355:"fields-MultiCheckbox-stories",489:"components-Notifier-stories",506:"Colors-stories",534:"formiks-FormikMultiCheckbox-stories",748:"fields-CheckPicker-CheckPicker-stories",868:"elements-Label-stories",920:"components-SideMenu-stories",1049:"fields-MultiRadio-stories",1356:"fields-MultiZoneEditor-stories",1581:"formiks-FormikSelect-stories",1627:"elements-Legend-stories",1765:"fields-DateRangePicker-stories",1936:"formiks-FormikDateRangePicker-stories",2139:"components-Dropdown-stories",2205:"fields-Search-WithOptionsAndCustomMenuItem-stories",2245:"elements-TagGroup-stories",2293:"tables-TableWithSelectableRows-stories",2377:"elements-Tag-stories",3340:"formiks-AutoComplete-WithOptions-stories",3397:"formiks-FormikEffect-stories",3618:"fields-Search-WithQuery-stories",3674:"Icon-stories",3709:"components-Dialog-stories",3856:"elements-IconButton-stories",3897:"tables-DataTable-stories",4012:"fields-DatePicker-stories",4167:"formiks-FormikTextarea-stories",4337:"fields-CheckPicker-CheckPickerWithCustomSearch-stories",4442:"formiks-FormikDatePicker-stories",4482:"fields-Checkbox-stories",4539:"symbols-ExclamationPoint-stories",4672:"components-Message-stories",4693:"formiks-AutoComplete-WithQuery-stories",5016:"tables-SimpleTable-stories",5138:"elements-SingleTag-stories",5189:"tests-button-stories",5453:"fields-Search-WithCustomSearch-stories",5590:"fields-Search-WithOptions-stories",6159:"formiks-FormikTextInput-stories",6330:"elements-Fieldset-stories",6337:"formiks-FormikMultiRadio-stories",6506:"fields-MultiSelect-MultiSelect-stories",6589:"formiks-FormikNumberInput-stories",6600:"fields-TextInput-stories",7249:"fields-CoordinatesInput-stories",7386:"formiks-FormikCoordinatesInput-stories",7754:"fields-Textarea-stories",8392:"elements-Field-stories",8696:"components-MapMenuModal-stories",8851:"fields-NumberInput-stories",9540:"fields-Select-Select-stories",9651:"fields-Select-SelectWithCustomSearch-stories",9929:"elements-Button-stories"}[chunkId]||chunkId)+"."+{231:"65119c99",270:"84fa0400",301:"59683467",355:"d89db4a0",489:"2fe5652e",506:"3c97f7a5",534:"887f12c6",748:"90dee4b5",868:"1a7c5ca9",920:"2e53d2e3",954:"66e028b3",1049:"ed66b820",1341:"68268516",1356:"cce9788b",1581:"820c1141",1627:"f1a9c93d",1729:"94edca2b",1765:"2e7f83f8",1936:"53a5634e",2139:"1ec7c803",2205:"eafe45b8",2245:"29931d67",2293:"d03a9788",2377:"0a997894",3019:"3f3f5feb",3340:"259ac632",3397:"54b43c69",3618:"65703b56",3674:"cf8c17cf",3709:"74523d95",3856:"1f4970aa",3897:"1a2831fd",4012:"7e2a9353",4167:"b70282f0",4337:"2aba5a24",4442:"22733159",4482:"8964eb8c",4539:"9a405a6e",4672:"5c05f828",4680:"9a8ac98d",4693:"2b5e6333",5016:"a97ccecb",5039:"dd795507",5138:"8aadee04",5189:"37c6f61d",5453:"2319e436",5590:"13c0912f",6081:"6913fe7b",6159:"ca3ecaef",6310:"78f37bcf",6330:"1cd244d2",6337:"cfd6c809",6506:"11057149",6589:"2beeeba7",6600:"d14b1540",6750:"95095023",7098:"a6455bf9",7151:"cbface9a",7249:"dec3fd62",7386:"3a00d3aa",7754:"213796cd",8392:"73276aec",8696:"efddd6d1",8800:"f93586c9",8851:"0696761d",9115:"d73ed64e",9540:"91815772",9651:"9066e91d",9929:"af939c92"}[chunkId]+".iframe.bundle.js"),__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=module=>((module=Object.create(module)).children||(module.children=[]),Object.defineProperty(module,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+module.id)}}),module),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),inProgress={},__webpack_require__.l=(url,done,key,chunkId)=>{if(inProgress[url])inProgress[url].push(done);else{var script,needAttach;if(void 0!==key)for(var scripts=document.getElementsByTagName("script"),i=0;i{script.onerror=script.onload=null,clearTimeout(timeout);var doneFns=inProgress[url];if(delete inProgress[url],script.parentNode&&script.parentNode.removeChild(script),doneFns&&doneFns.forEach((fn=>fn(event))),prev)return prev(event)},timeout=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:script}),12e4);script.onerror=onScriptComplete.bind(null,script.onerror),script.onload=onScriptComplete.bind(null,script.onload),needAttach&&document.head.appendChild(script)}},__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),__webpack_require__.p="",(()=>{var installedChunks={1303:0};__webpack_require__.f.j=(chunkId,promises)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(1303!=chunkId){var promise=new Promise(((resolve,reject)=>installedChunkData=installedChunks[chunkId]=[resolve,reject]));promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.u(chunkId),error=new Error;__webpack_require__.l(url,(event=>{if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData)){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}}),"chunk-"+chunkId,chunkId)}else installedChunks[chunkId]=0},__webpack_require__.O.j=chunkId=>0===installedChunks[chunkId];var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var moduleId,chunkId,[chunkIds,moreModules,runtime]=data,i=0;if(chunkIds.some((id=>0!==installedChunks[id]))){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i{"use strict";var deferred,leafPrototypes,getProto,inProgress,__webpack_modules__={},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.amdO={},deferred=[],__webpack_require__.O=(result,chunkIds,fn,priority)=>{if(!chunkIds){var notFulfilled=1/0;for(i=0;i=priority)&&Object.keys(__webpack_require__.O).every((key=>__webpack_require__.O[key](chunkIds[j])))?chunkIds.splice(j--,1):(fulfilled=!1,priority0&&deferred[i-1][2]>priority;i--)deferred[i]=deferred[i-1];deferred[i]=[chunkIds,fn,priority]},__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,__webpack_require__.t=function(value,mode){if(1&mode&&(value=this(value)),8&mode)return value;if("object"==typeof value&&value){if(4&mode&&value.__esModule)return value;if(16&mode&&"function"==typeof value.then)return value}var ns=Object.create(null);__webpack_require__.r(ns);var def={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var current=2&mode&&value;"object"==typeof current&&!~leafPrototypes.indexOf(current);current=getProto(current))Object.getOwnPropertyNames(current).forEach((key=>def[key]=()=>value[key]));return def.default=()=>value,__webpack_require__.d(ns,def),ns},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.f={},__webpack_require__.e=chunkId=>Promise.all(Object.keys(__webpack_require__.f).reduce(((promises,key)=>(__webpack_require__.f[key](chunkId,promises),promises)),[])),__webpack_require__.u=chunkId=>(({231:"fields-MultiSelect-MultiSelectWithCustomSearch-stories",270:"formiks-FormikCheckbox-stories",301:"formiks-FormikMultiSelect-stories",355:"fields-MultiCheckbox-stories",489:"components-Notifier-stories",506:"Colors-stories",534:"formiks-FormikMultiCheckbox-stories",748:"fields-CheckPicker-CheckPicker-stories",868:"elements-Label-stories",920:"components-SideMenu-stories",1049:"fields-MultiRadio-stories",1356:"fields-MultiZoneEditor-stories",1581:"formiks-FormikSelect-stories",1627:"elements-Legend-stories",1765:"fields-DateRangePicker-stories",1936:"formiks-FormikDateRangePicker-stories",2139:"components-Dropdown-stories",2205:"fields-Search-WithOptionsAndCustomMenuItem-stories",2245:"elements-TagGroup-stories",2293:"tables-TableWithSelectableRows-stories",2377:"elements-Tag-stories",3340:"formiks-AutoComplete-WithOptions-stories",3397:"formiks-FormikEffect-stories",3618:"fields-Search-WithQuery-stories",3674:"Icon-stories",3709:"components-Dialog-stories",3856:"elements-IconButton-stories",3897:"tables-DataTable-stories",4012:"fields-DatePicker-stories",4167:"formiks-FormikTextarea-stories",4337:"fields-CheckPicker-CheckPickerWithCustomSearch-stories",4442:"formiks-FormikDatePicker-stories",4482:"fields-Checkbox-stories",4539:"symbols-ExclamationPoint-stories",4672:"components-Message-stories",4693:"formiks-AutoComplete-WithQuery-stories",5016:"tables-SimpleTable-stories",5138:"elements-SingleTag-stories",5189:"tests-button-stories",5453:"fields-Search-WithCustomSearch-stories",5590:"fields-Search-WithOptions-stories",6159:"formiks-FormikTextInput-stories",6330:"elements-Fieldset-stories",6337:"formiks-FormikMultiRadio-stories",6506:"fields-MultiSelect-MultiSelect-stories",6589:"formiks-FormikNumberInput-stories",6600:"fields-TextInput-stories",7249:"fields-CoordinatesInput-stories",7386:"formiks-FormikCoordinatesInput-stories",7754:"fields-Textarea-stories",8392:"elements-Field-stories",8696:"components-MapMenuModal-stories",8851:"fields-NumberInput-stories",9540:"fields-Select-Select-stories",9651:"fields-Select-SelectWithCustomSearch-stories",9929:"elements-Button-stories"}[chunkId]||chunkId)+"."+{231:"65119c99",270:"84fa0400",301:"59683467",355:"d89db4a0",489:"2fe5652e",506:"3c97f7a5",534:"887f12c6",748:"90dee4b5",868:"1a7c5ca9",920:"2e53d2e3",954:"66e028b3",1049:"ed66b820",1341:"68268516",1356:"cce9788b",1581:"820c1141",1627:"f1a9c93d",1729:"94edca2b",1765:"2e7f83f8",1936:"53a5634e",2139:"1ec7c803",2205:"eafe45b8",2245:"29931d67",2293:"50882eda",2377:"0a997894",3019:"3f3f5feb",3340:"259ac632",3397:"54b43c69",3618:"65703b56",3674:"cf8c17cf",3709:"74523d95",3856:"1f4970aa",3897:"1a2831fd",4012:"7e2a9353",4167:"b70282f0",4337:"2aba5a24",4442:"22733159",4482:"8964eb8c",4539:"9a405a6e",4672:"5c05f828",4680:"9a8ac98d",4693:"2b5e6333",5016:"973c0267",5039:"dd795507",5138:"8aadee04",5189:"37c6f61d",5453:"2319e436",5590:"13c0912f",6081:"6913fe7b",6159:"ca3ecaef",6310:"78f37bcf",6330:"1cd244d2",6337:"cfd6c809",6506:"11057149",6589:"2beeeba7",6600:"d14b1540",6750:"95095023",7098:"a6455bf9",7151:"cbface9a",7249:"dec3fd62",7386:"3a00d3aa",7754:"213796cd",8392:"73276aec",8696:"efddd6d1",8800:"f93586c9",8851:"0696761d",9115:"d73ed64e",9540:"91815772",9651:"9066e91d",9929:"af939c92"}[chunkId]+".iframe.bundle.js"),__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=module=>((module=Object.create(module)).children||(module.children=[]),Object.defineProperty(module,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+module.id)}}),module),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),inProgress={},__webpack_require__.l=(url,done,key,chunkId)=>{if(inProgress[url])inProgress[url].push(done);else{var script,needAttach;if(void 0!==key)for(var scripts=document.getElementsByTagName("script"),i=0;i{script.onerror=script.onload=null,clearTimeout(timeout);var doneFns=inProgress[url];if(delete inProgress[url],script.parentNode&&script.parentNode.removeChild(script),doneFns&&doneFns.forEach((fn=>fn(event))),prev)return prev(event)},timeout=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:script}),12e4);script.onerror=onScriptComplete.bind(null,script.onerror),script.onload=onScriptComplete.bind(null,script.onload),needAttach&&document.head.appendChild(script)}},__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),__webpack_require__.p="",(()=>{var installedChunks={1303:0};__webpack_require__.f.j=(chunkId,promises)=>{var installedChunkData=__webpack_require__.o(installedChunks,chunkId)?installedChunks[chunkId]:void 0;if(0!==installedChunkData)if(installedChunkData)promises.push(installedChunkData[2]);else if(1303!=chunkId){var promise=new Promise(((resolve,reject)=>installedChunkData=installedChunks[chunkId]=[resolve,reject]));promises.push(installedChunkData[2]=promise);var url=__webpack_require__.p+__webpack_require__.u(chunkId),error=new Error;__webpack_require__.l(url,(event=>{if(__webpack_require__.o(installedChunks,chunkId)&&(0!==(installedChunkData=installedChunks[chunkId])&&(installedChunks[chunkId]=void 0),installedChunkData)){var errorType=event&&("load"===event.type?"missing":event.type),realSrc=event&&event.target&&event.target.src;error.message="Loading chunk "+chunkId+" failed.\n("+errorType+": "+realSrc+")",error.name="ChunkLoadError",error.type=errorType,error.request=realSrc,installedChunkData[1](error)}}),"chunk-"+chunkId,chunkId)}else installedChunks[chunkId]=0},__webpack_require__.O.j=chunkId=>0===installedChunks[chunkId];var webpackJsonpCallback=(parentChunkLoadingFunction,data)=>{var moduleId,chunkId,[chunkIds,moreModules,runtime]=data,i=0;if(chunkIds.some((id=>0!==installedChunks[id]))){for(moduleId in moreModules)__webpack_require__.o(moreModules,moduleId)&&(__webpack_require__.m[moduleId]=moreModules[moduleId]);if(runtime)var result=runtime(__webpack_require__)}for(parentChunkLoadingFunction&&parentChunkLoadingFunction(data);i{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{_SimpleTable:()=>_SimpleTable,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@tanstack/react-table/build/lib/index.mjs"),_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@tanstack/table-core/build/lib/index.mjs"),_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@tanstack/react-virtual/build/lib/index.mjs"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./.storybook/components/StoryDecorator.tsx"),_src__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/index.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const data=[...Array(100).fill({closedBy:"TIM",controlUnits:[{administration:"DDTM",contact:void 0,id:10003,isArchived:!1,name:"DML 2A",resources:[]}],endDateTimeUtc:"19 juin 23, 09h28 (UTC)",envActions:[{actionNumberOfControls:1,actionStartDateTimeUtc:void 0,actionTargetType:"COMPANY",actionType:"CONTROL",geom:{type:"MultiPoint",coordinates:[[-2.63708273,48.17060427]]},id:"f3e90d3a-6ba4-4bb3-805e-d391508aa46d",infractions:[],observations:void 0,themes:[{protectedSpecies:["MARINE_MAMMALS"],subThemes:["Dérogations concernant les espèces protégées"],theme:"Police des espèces protégées et de leurs habitats (faune et flore)"}],vehicleType:void 0}],facade:"Guyane",geom:{type:"MultiPolygon"},hasMissionOrder:!1,id:38,isClosed:!0,isUnderJdp:!1,missionNature:["ENV","FISH"],missionSource:"MONITORENV",missionTypes:["LAND"],observationsCacem:"Black bit sell. House relate policy once. White member worker east even anyone detail professor.",observationsCnsp:void 0,openBy:"RAN",startDateTimeUtc:"23 juin 23, 05h57 (UTC)"}),...Array(100).fill({closedBy:"TIM",controlUnits:[{administration:"DDTM",contact:void 0,id:10003,isArchived:!1,name:"DML 2A",resources:[]}],endDateTimeUtc:"23 juin 23, 09h28 (UTC)",envActions:[{actionNumberOfControls:1,actionStartDateTimeUtc:void 0,actionTargetType:"COMPANY",actionType:"CONTROL",geom:{type:"MultiPoint",coordinates:[[-2.63708273,48.17060427]]},id:"f3e90d3a-6ba4-4bb3-805e-d391508aa46d",infractions:[],observations:void 0,themes:[{protectedSpecies:["MARINE_MAMMALS"],subThemes:["Dérogations concernant les espèces protégées"],theme:"Police des espèces protégées et de leurs habitats (faune et flore)"}],vehicleType:void 0}],facade:"Guadeloupe",geom:{type:"MultiPolygon"},hasMissionOrder:!1,id:38,isClosed:!0,isUnderJdp:!1,missionNature:["ENV","FISH"],missionSource:"MONITORENV",missionTypes:["LAND"],observationsCacem:"",observationsCnsp:void 0,openBy:"RAN",startDateTimeUtc:"01 mai 23, 05h57 (UTC)"})],__WEBPACK_DEFAULT_EXPORT__={title:"Tables/SimpleTable",decorators:[(0,_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__.N)()]};function _SimpleTable(){const[sorting,setSorting]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([{id:"dateDebut",desc:!1}]),columns=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>[{accessorFn:row=>row.startDateTimeUtc,id:"dateDebut",cell:info=>info.getValue(),header:()=>"Début",enableResizing:!0,size:180},{accessorFn:row=>row.endDateTimeUtc,id:"dateFin",cell:info=>info.getValue(),header:()=>"Fin",enableResizing:!0,size:180},{accessorFn:row=>row.missionSource,id:"missionSource",cell:info=>info.getValue(),header:()=>"Origine",enableResizing:!0,size:90},{accessorFn:row=>row?.controlUnits?.map((controlUnit=>`${controlUnit.name} (${controlUnit.administration})`)).join(" / "),id:"Unit and Administration",cell:info=>info.getValue(),header:()=>"Unité (Administration)",enableSorting:!1,enableResizing:!0,maxSize:280,minSize:100,size:200},{accessorFn:row=>row.missionTypes,id:"type",cell:info=>info.getValue(),header:()=>"Type",enableSorting:!1,enableResizing:!0,size:100},{accessorFn:row=>row.facade,id:"seaFront",cell:info=>info.getValue(),header:()=>"Facade",enableResizing:!0,size:100},{accessorFn:row=>row.observationsCacem,id:"observationsCacem",cell:info=>info.getValue(),header:()=>"Thématiques",enableSorting:!1,enableResizing:!0,maxSize:280,minSize:100,size:200},{accessorFn:row=>row.controlUnits.length,id:"controls",cell:info=>info.getValue(),header:()=>"Nbre contrôles",enableSorting:!1,enableResizing:!0,size:100},{accessorFn:row=>row.status,id:"status",cell:info=>info.getValue(),header:()=>"Statut",enableSorting:!1,enableResizing:!0,size:100},{accessorFn:row=>row.geom,id:"geom",cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.FocusZones,onClick:()=>console.log(info.getValue()),size:_src__WEBPACK_IMPORTED_MODULE_2__.$u.SMALL}),header:()=>"",enableSorting:!1,enableResizing:!0,size:60},{accessorFn:row=>row.id,id:"edit",cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.zx,{Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Edit,onClick:()=>console.log(info.getValue()),size:_src__WEBPACK_IMPORTED_MODULE_2__.$u.SMALL,children:"Editer"}),header:()=>"",enableSorting:!1,enableResizing:!0,size:160}]),[]),table=(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__.b7)({columns,data,state:{sorting},enableSortingRemoval:!1,onSortingChange:setSorting,getCoreRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.sC)(),getSortedRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.tj)()}),tableContainerRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),{rows}=table.getRowModel(),rowVirtualizer=(0,_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_6__.MG)({count:rows.length,getScrollElement:()=>tableContainerRef.current,estimateSize:()=>10,overscan:10,getItemKey:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((index=>`${rows[index]?.id}`),[rows])}),virtualRows=rowVirtualizer.getVirtualItems(),[paddingTop,paddingBottom]=virtualRows.length>0?[Math.max(0,virtualRows[0]?.start||0),Math.max(0,rowVirtualizer.getTotalSize()-(virtualRows[virtualRows.length-1]?.end||0))]:[0,0];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{ref:tableContainerRef,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Table,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Head,{children:table.getHeaderGroups().map((headerGroup=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("tr",{children:headerGroup.headers.map((header=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Th,{style:{maxWidth:header.column.getSize(),minWidth:header.column.getSize(),width:header.column.getSize()},children:header.isPlaceholder?void 0:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.SortContainer,{className:header.column.getCanSort()?"cursor-pointer":"",onClick:header.column.getToggleSortingHandler(),children:[(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__.ie)(header.column.columnDef.header,header.getContext()),header.column.getCanSort()&&({asc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{children:"▲"}),desc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{children:"▼"})}[header.column.getIsSorted()]??(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.JO.SortingArrows,{size:14}))]})},header.id)))},headerGroup.id)))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("tbody",{children:[paddingTop>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("td",{style:{height:`${paddingTop}px`}})}),virtualRows.map((virtualRow=>{const row=rows[virtualRow.index];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.BodyTr,{children:row?.getVisibleCells().map((cell=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Td,{key:cell.id,style:{maxWidth:cell.column.getSize(),minWidth:cell.column.getSize(),width:cell.column.getSize()},$isCenter:!("geom"!==cell.column.id&&"edit"!==cell.column.id),children:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__.ie)(cell.column.columnDef.cell,cell.getContext())})))},virtualRow.key)})),paddingBottom>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("td",{style:{height:`${paddingBottom}px`}})})]})]})})}_SimpleTable.displayName="_SimpleTable",_SimpleTable.parameters={..._SimpleTable.parameters,docs:{..._SimpleTable.parameters?.docs,source:{originalSource:"function _SimpleTable() {\n const [sorting, setSorting] = useState([{\n id: 'dateDebut',\n desc: false\n }]);\n const columns = useMemo(() => [{\n accessorFn: row => row.startDateTimeUtc,\n id: 'dateDebut',\n cell: info => info.getValue(),\n header: () => 'Début',\n enableResizing: true,\n size: 180\n }, {\n accessorFn: row => row.endDateTimeUtc,\n id: 'dateFin',\n cell: info => info.getValue(),\n header: () => 'Fin',\n enableResizing: true,\n size: 180\n }, {\n accessorFn: row => row.missionSource,\n id: 'missionSource',\n cell: info => info.getValue(),\n header: () => 'Origine',\n enableResizing: true,\n size: 90\n }, {\n accessorFn: row => row?.controlUnits?.map(controlUnit => `${controlUnit.name} (${controlUnit.administration})`).join(' / '),\n id: 'Unit and Administration',\n cell: info => info.getValue(),\n header: () => 'Unité (Administration)',\n enableSorting: false,\n enableResizing: true,\n maxSize: 280,\n minSize: 100,\n size: 200\n }, {\n accessorFn: row => row.missionTypes,\n id: 'type',\n cell: info => info.getValue(),\n header: () => 'Type',\n enableSorting: false,\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.facade,\n id: 'seaFront',\n cell: info => info.getValue(),\n header: () => 'Facade',\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.observationsCacem,\n id: 'observationsCacem',\n cell: info => info.getValue(),\n header: () => 'Thématiques',\n enableSorting: false,\n enableResizing: true,\n maxSize: 280,\n minSize: 100,\n size: 200\n }, {\n accessorFn: row => row.controlUnits.length,\n id: 'controls',\n cell: info => info.getValue(),\n header: () => 'Nbre contrôles',\n enableSorting: false,\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.status,\n id: 'status',\n cell: info => info.getValue(),\n header: () => 'Statut',\n enableSorting: false,\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.geom,\n id: 'geom',\n cell: info => console.log(info.getValue())} size={Size.SMALL} />,\n header: () => '',\n enableSorting: false,\n enableResizing: true,\n size: 60\n }, {\n accessorFn: row => row.id,\n id: 'edit',\n cell: info =>\n // eslint-disable-next-line no-console\n ,\n header: () => '',\n enableSorting: false,\n enableResizing: true,\n size: 160\n }], []);\n const table = useReactTable({\n columns,\n data,\n state: {\n sorting\n },\n enableSortingRemoval: false,\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel()\n });\n\n // eslint-disable-next-line no-null/no-null\n const tableContainerRef = useRef(null);\n const {\n rows\n } = table.getRowModel();\n const rowVirtualizer = useVirtualizer({\n count: rows.length,\n getScrollElement: () => tableContainerRef.current,\n estimateSize: () => 10,\n overscan: 10,\n // Pass correct keys to virtualizer it's important when rows change position\n getItemKey: useCallback((index: number) => `${rows[index]?.id}`, [rows])\n });\n const virtualRows = rowVirtualizer.getVirtualItems();\n const [paddingTop, paddingBottom] = virtualRows.length > 0 ? [Math.max(0, virtualRows[0]?.start || 0), Math.max(0, rowVirtualizer.getTotalSize() - (virtualRows[virtualRows.length - 1]?.end || 0))] : [0, 0];\n return
\n \n \n {table.getHeaderGroups().map(headerGroup => \n {headerGroup.headers.map(header => \n {header.isPlaceholder ? undefined : \n {flexRender(header.column.columnDef.header, header.getContext())}\n {header.column.getCanSort() && ({\n asc:
,\n desc:
\n }[(header.column.getIsSorted() as string)] ?? )}\n
}\n
)}\n )}\n
\n \n {paddingTop > 0 && \n \n }\n {virtualRows.map(virtualRow => {\n const row = rows[virtualRow.index];\n return \n {row?.getVisibleCells().map(cell => \n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n )}\n ;\n })}\n {paddingBottom > 0 && \n \n }\n \n
\n
;\n}",..._SimpleTable.parameters?.docs?.source}}};const __namedExportsOrder=["_SimpleTable"]}}]); -//# sourceMappingURL=tables-SimpleTable-stories.a97ccecb.iframe.bundle.js.map \ No newline at end of file +`;try{generateStoryDecorator.displayName="generateStoryDecorator",generateStoryDecorator.__docgenInfo={description:"",displayName:"generateStoryDecorator",props:{fixedWidth:{defaultValue:null,description:"",name:"fixedWidth",required:!1,type:{name:"number"}},hasDarkMode:{defaultValue:{value:"false"},description:"",name:"hasDarkMode",required:!1,type:{name:"boolean"}},withNewWindowButton:{defaultValue:{value:"false"},description:"",name:"withNewWindowButton",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES[".storybook/components/StoryDecorator.tsx#generateStoryDecorator"]={docgenInfo:generateStoryDecorator.__docgenInfo,name:"generateStoryDecorator",path:".storybook/components/StoryDecorator.tsx#generateStoryDecorator"})}catch(__react_docgen_typescript_loader_error){}},"./stories/tables/SimpleTable.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{_SimpleTable:()=>_SimpleTable,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@tanstack/react-table/build/lib/index.mjs"),_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@tanstack/table-core/build/lib/index.mjs"),_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@tanstack/react-virtual/build/lib/index.mjs"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./.storybook/components/StoryDecorator.tsx"),_src__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/index.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const data=[...Array(100).fill({closedBy:"TIM",controlUnits:[{administration:"DDTM",contact:void 0,id:10003,isArchived:!1,name:"DML 2A",resources:[]}],endDateTimeUtc:"19 juin 23, 09h28 (UTC)",envActions:[{actionNumberOfControls:1,actionStartDateTimeUtc:void 0,actionTargetType:"COMPANY",actionType:"CONTROL",geom:{type:"MultiPoint",coordinates:[[-2.63708273,48.17060427]]},id:"f3e90d3a-6ba4-4bb3-805e-d391508aa46d",infractions:[],observations:void 0,themes:[{protectedSpecies:["MARINE_MAMMALS"],subThemes:["Dérogations concernant les espèces protégées"],theme:"Police des espèces protégées et de leurs habitats (faune et flore)"}],vehicleType:void 0}],facade:"Guyane",geom:{type:"MultiPolygon"},hasMissionOrder:!1,id:38,isClosed:!0,isUnderJdp:!1,missionNature:["ENV","FISH"],missionSource:"MONITORENV",missionTypes:["LAND"],observationsCacem:"Black bit sell. House relate policy once. White member worker east even anyone detail professor.",observationsCnsp:void 0,openBy:"RAN",startDateTimeUtc:"23 juin 23, 05h57 (UTC)"}),...Array(100).fill({closedBy:"TIM",controlUnits:[{administration:"DDTM",contact:void 0,id:10003,isArchived:!1,name:"DML 2A",resources:[]}],endDateTimeUtc:"23 juin 23, 09h28 (UTC)",envActions:[{actionNumberOfControls:1,actionStartDateTimeUtc:void 0,actionTargetType:"COMPANY",actionType:"CONTROL",geom:{type:"MultiPoint",coordinates:[[-2.63708273,48.17060427]]},id:"f3e90d3a-6ba4-4bb3-805e-d391508aa46d",infractions:[],observations:void 0,themes:[{protectedSpecies:["MARINE_MAMMALS"],subThemes:["Dérogations concernant les espèces protégées"],theme:"Police des espèces protégées et de leurs habitats (faune et flore)"}],vehicleType:void 0}],facade:"Guadeloupe",geom:{type:"MultiPolygon"},hasMissionOrder:!1,id:38,isClosed:!0,isUnderJdp:!1,missionNature:["ENV","FISH"],missionSource:"MONITORENV",missionTypes:["LAND"],observationsCacem:"",observationsCnsp:void 0,openBy:"RAN",startDateTimeUtc:"01 mai 23, 05h57 (UTC)"})],__WEBPACK_DEFAULT_EXPORT__={title:"Tables/SimpleTable",decorators:[(0,_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__.N)()]};function _SimpleTable(){const[sorting,setSorting]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([{id:"dateDebut",desc:!1}]),columns=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>[{accessorFn:row=>row.startDateTimeUtc,id:"dateDebut",cell:info=>info.getValue(),header:()=>"Début",enableResizing:!0,size:180},{accessorFn:row=>row.endDateTimeUtc,id:"dateFin",cell:info=>info.getValue(),header:()=>"Fin",enableResizing:!0,size:180},{accessorFn:row=>row.missionSource,id:"missionSource",cell:info=>info.getValue(),header:()=>"Origine",enableResizing:!0,size:90},{accessorFn:row=>row?.controlUnits?.map((controlUnit=>`${controlUnit.name} (${controlUnit.administration})`)).join(" / "),id:"Unit and Administration",cell:info=>info.getValue(),header:()=>"Unité (Administration)",enableSorting:!1,enableResizing:!0,maxSize:280,minSize:100,size:200},{accessorFn:row=>row.missionTypes,id:"type",cell:info=>info.getValue(),header:()=>"Type",enableSorting:!1,enableResizing:!0,size:100},{accessorFn:row=>row.facade,id:"seaFront",cell:info=>info.getValue(),header:()=>"Facade",enableResizing:!0,size:100},{accessorFn:row=>row.observationsCacem,id:"observationsCacem",cell:info=>info.getValue(),header:()=>"Thématiques",enableSorting:!1,enableResizing:!0,maxSize:280,minSize:100,size:200},{accessorFn:row=>row.controlUnits.length,id:"controls",cell:info=>info.getValue(),header:()=>"Nbre contrôles",enableSorting:!1,enableResizing:!0,size:100},{accessorFn:row=>row.status,id:"status",cell:info=>info.getValue(),header:()=>"Statut",enableSorting:!1,enableResizing:!0,size:100},{accessorFn:row=>row.geom,id:"geom",cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.FocusZones,onClick:()=>console.log(info.getValue()),size:_src__WEBPACK_IMPORTED_MODULE_2__.$u.SMALL}),header:()=>"",enableSorting:!1,enableResizing:!0,size:60},{accessorFn:row=>row.id,id:"edit",cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.zx,{Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Edit,onClick:()=>console.log(info.getValue()),size:_src__WEBPACK_IMPORTED_MODULE_2__.$u.SMALL,children:"Editer"}),header:()=>"",enableSorting:!1,enableResizing:!0,size:160}]),[]),table=(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__.b7)({columns,data,state:{sorting},enableSortingRemoval:!1,onSortingChange:setSorting,getCoreRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.sC)(),getSortedRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.tj)()}),tableContainerRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),{rows}=table.getRowModel(),rowVirtualizer=(0,_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_6__.MG)({count:rows.length,getScrollElement:()=>tableContainerRef.current,estimateSize:()=>10,overscan:10,getItemKey:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((index=>`${rows[index]?.id}`),[rows])}),virtualRows=rowVirtualizer.getVirtualItems(),[paddingTop,paddingBottom]=virtualRows.length>0?[Math.max(0,virtualRows[0]?.start??0),Math.max(0,rowVirtualizer.getTotalSize()-(virtualRows[virtualRows.length-1]?.end??0))]:[0,0];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{ref:tableContainerRef,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Table,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Head,{children:table.getHeaderGroups().map((headerGroup=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("tr",{children:headerGroup.headers.map((header=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Th,{style:{maxWidth:header.column.getSize(),minWidth:header.column.getSize(),width:header.column.getSize()},children:header.isPlaceholder?void 0:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.SortContainer,{className:header.column.getCanSort()?"cursor-pointer":"",onClick:header.column.getToggleSortingHandler(),children:[(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__.ie)(header.column.columnDef.header,header.getContext()),header.column.getCanSort()&&({asc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{children:"▲"}),desc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{children:"▼"})}[header.column.getIsSorted()]??(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.JO.SortingArrows,{size:14}))]})},header.id)))},headerGroup.id)))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("tbody",{children:[paddingTop>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("td",{style:{height:`${paddingTop}px`}})}),virtualRows.map((virtualRow=>{const row=rows[virtualRow.index];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.BodyTr,{children:row?.getVisibleCells().map((cell=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.xS.Td,{key:cell.id,style:{maxWidth:cell.column.getSize(),minWidth:cell.column.getSize(),width:cell.column.getSize()},$isCenter:!("geom"!==cell.column.id&&"edit"!==cell.column.id),children:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_4__.ie)(cell.column.columnDef.cell,cell.getContext())})))},virtualRow.key)})),paddingBottom>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("td",{style:{height:`${paddingBottom}px`}})})]})]})})}_SimpleTable.displayName="_SimpleTable",_SimpleTable.parameters={..._SimpleTable.parameters,docs:{..._SimpleTable.parameters?.docs,source:{originalSource:"function _SimpleTable() {\n const [sorting, setSorting] = useState([{\n id: 'dateDebut',\n desc: false\n }]);\n const columns = useMemo(() => [{\n accessorFn: row => row.startDateTimeUtc,\n id: 'dateDebut',\n cell: info => info.getValue(),\n header: () => 'Début',\n enableResizing: true,\n size: 180\n }, {\n accessorFn: row => row.endDateTimeUtc,\n id: 'dateFin',\n cell: info => info.getValue(),\n header: () => 'Fin',\n enableResizing: true,\n size: 180\n }, {\n accessorFn: row => row.missionSource,\n id: 'missionSource',\n cell: info => info.getValue(),\n header: () => 'Origine',\n enableResizing: true,\n size: 90\n }, {\n accessorFn: row => row?.controlUnits?.map(controlUnit => `${controlUnit.name} (${controlUnit.administration})`).join(' / '),\n id: 'Unit and Administration',\n cell: info => info.getValue(),\n header: () => 'Unité (Administration)',\n enableSorting: false,\n enableResizing: true,\n maxSize: 280,\n minSize: 100,\n size: 200\n }, {\n accessorFn: row => row.missionTypes,\n id: 'type',\n cell: info => info.getValue(),\n header: () => 'Type',\n enableSorting: false,\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.facade,\n id: 'seaFront',\n cell: info => info.getValue(),\n header: () => 'Facade',\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.observationsCacem,\n id: 'observationsCacem',\n cell: info => info.getValue(),\n header: () => 'Thématiques',\n enableSorting: false,\n enableResizing: true,\n maxSize: 280,\n minSize: 100,\n size: 200\n }, {\n accessorFn: row => row.controlUnits.length,\n id: 'controls',\n cell: info => info.getValue(),\n header: () => 'Nbre contrôles',\n enableSorting: false,\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.status,\n id: 'status',\n cell: info => info.getValue(),\n header: () => 'Statut',\n enableSorting: false,\n enableResizing: true,\n size: 100\n }, {\n accessorFn: row => row.geom,\n id: 'geom',\n cell: info => console.log(info.getValue())} size={Size.SMALL} />,\n header: () => '',\n enableSorting: false,\n enableResizing: true,\n size: 60\n }, {\n accessorFn: row => row.id,\n id: 'edit',\n cell: info =>\n // eslint-disable-next-line no-console\n ,\n header: () => '',\n enableSorting: false,\n enableResizing: true,\n size: 160\n }], []);\n const table = useReactTable({\n columns,\n data,\n state: {\n sorting\n },\n enableSortingRemoval: false,\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel()\n });\n\n // eslint-disable-next-line no-null/no-null\n const tableContainerRef = useRef(null);\n const {\n rows\n } = table.getRowModel();\n const rowVirtualizer = useVirtualizer({\n count: rows.length,\n getScrollElement: () => tableContainerRef.current,\n estimateSize: () => 10,\n overscan: 10,\n // Pass correct keys to virtualizer it's important when rows change position\n getItemKey: useCallback((index: number) => `${rows[index]?.id}`, [rows])\n });\n const virtualRows = rowVirtualizer.getVirtualItems();\n const [paddingTop, paddingBottom] = virtualRows.length > 0 ? [Math.max(0, virtualRows[0]?.start ?? 0), Math.max(0, rowVirtualizer.getTotalSize() - (virtualRows[virtualRows.length - 1]?.end ?? 0))] : [0, 0];\n return
\n \n \n {table.getHeaderGroups().map(headerGroup => \n {headerGroup.headers.map(header => \n {header.isPlaceholder ? undefined : \n {flexRender(header.column.columnDef.header, header.getContext())}\n {header.column.getCanSort() && ({\n asc:
,\n desc:
\n }[(header.column.getIsSorted() as string)] ?? )}\n
}\n
)}\n )}\n
\n \n {paddingTop > 0 && \n \n }\n {virtualRows.map(virtualRow => {\n const row = rows[virtualRow.index];\n return \n {row?.getVisibleCells().map(cell => \n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n )}\n ;\n })}\n {paddingBottom > 0 && \n \n }\n \n
\n
;\n}",..._SimpleTable.parameters?.docs?.source}}};const __namedExportsOrder=["_SimpleTable"]}}]); +//# sourceMappingURL=tables-SimpleTable-stories.973c0267.iframe.bundle.js.map \ No newline at end of file diff --git a/tables-SimpleTable-stories.a97ccecb.iframe.bundle.js.map b/tables-SimpleTable-stories.973c0267.iframe.bundle.js.map similarity index 98% rename from tables-SimpleTable-stories.a97ccecb.iframe.bundle.js.map rename to tables-SimpleTable-stories.973c0267.iframe.bundle.js.map index c8d6d6267..671e9c542 100644 --- a/tables-SimpleTable-stories.a97ccecb.iframe.bundle.js.map +++ b/tables-SimpleTable-stories.973c0267.iframe.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"tables-SimpleTable-stories.a97ccecb.iframe.bundle.js","mappings":";;;;AA6HA;;;;AAKA","sources":["webpack://@mtes-mct/monitor-ui__root/./.storybook/components/StoryDecorator.tsx"],"sourcesContent":["import { forwardRef, useEffect, useImperativeHandle, useMemo, useState, useRef } from 'react'\nimport styled from 'styled-components'\n\nimport { GlobalDecoratorWrapper } from './GlobalDecorator'\nimport { Accent, Button, NewWindow, Size, THEME, useForceUpdate, useNewWindow, NewWindowContext } from '../../src'\n\nimport type { NewWindowContextValue } from '../../src'\nimport type { StoryContext, StoryFn, StrictArgs } from '@storybook/react'\nimport type { ForwardedRef, MutableRefObject } from 'react'\n\nexport function generateStoryDecorator({\n fixedWidth,\n hasDarkMode = false,\n withNewWindowButton = false\n}: {\n fixedWidth?: number\n hasDarkMode?: boolean\n withNewWindowButton?: boolean\n} = {}) {\n return function StoryDecorator(Story: StoryFn, { args }: StoryContext) {\n const newWindowRef = useRef() as MutableRefObject\n\n const [isNewWindowOpen, setIsNewWindowOpen] = useState(false)\n\n const style = useMemo(\n () => ({\n ...(fixedWidth\n ? {\n width: `${fixedWidth}px`\n }\n : {}),\n ...(hasDarkMode\n ? {\n backgroundColor: args.isLight ? THEME.color.gainsboro : THEME.color.white\n }\n : {})\n }),\n [args.isLight]\n )\n\n const { forceUpdate } = useForceUpdate()\n\n useEffect(() => {\n forceUpdate()\n }, [forceUpdate])\n\n return (\n <>\n {withNewWindowButton && (\n \n \n \n )}\n\n {!isNewWindowOpen && (\n \n \n \n )}\n\n {withNewWindowButton && isNewWindowOpen && (\n setIsNewWindowOpen(false)}>\n \n \n )}\n \n )\n }\n}\n\nfunction NewWindowStoryWrapperWithRef(\n { Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs },\n ref: ForwardedRef\n) {\n // eslint-disable-next-line no-null/no-null\n const wrapperRef = useRef(null)\n\n const [isFirstRender, setIsFirstRender] = useState(true)\n\n useImperativeHandle(ref, () => wrapperRef.current)\n\n const newWindowContextProviderValue: NewWindowContextValue = useMemo(\n () => ({\n newWindowContainerRef: wrapperRef.current\n ? (wrapperRef as MutableRefObject)\n : { current: window.document.createElement('div') }\n }),\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isFirstRender]\n )\n\n useEffect(() => {\n setIsFirstRender(false)\n }, [])\n\n return (\n \n {!isFirstRender && (\n \n \n \n \n \n )}\n \n )\n}\n\nconst NewWindowStoryWrapper = forwardRef(NewWindowStoryWrapperWithRef)\n\nfunction NewWindowStory({ Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs }) {\n const { newWindowContainerRef } = useNewWindow()\n\n return \n}\n\nconst StoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n\nconst NewWindowButtonBox = styled.div`\n position: fixed;\n right: 16px;\n top: 16px;\n`\nconst NewWindowStoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"tables-SimpleTable-stories.973c0267.iframe.bundle.js","mappings":";;;;AA6HA;;;;AAKA","sources":["webpack://@mtes-mct/monitor-ui__root/./.storybook/components/StoryDecorator.tsx"],"sourcesContent":["import { forwardRef, useEffect, useImperativeHandle, useMemo, useState, useRef } from 'react'\nimport styled from 'styled-components'\n\nimport { GlobalDecoratorWrapper } from './GlobalDecorator'\nimport { Accent, Button, NewWindow, Size, THEME, useForceUpdate, useNewWindow, NewWindowContext } from '../../src'\n\nimport type { NewWindowContextValue } from '../../src'\nimport type { StoryContext, StoryFn, StrictArgs } from '@storybook/react'\nimport type { ForwardedRef, MutableRefObject } from 'react'\n\nexport function generateStoryDecorator({\n fixedWidth,\n hasDarkMode = false,\n withNewWindowButton = false\n}: {\n fixedWidth?: number\n hasDarkMode?: boolean\n withNewWindowButton?: boolean\n} = {}) {\n return function StoryDecorator(Story: StoryFn, { args }: StoryContext) {\n const newWindowRef = useRef() as MutableRefObject\n\n const [isNewWindowOpen, setIsNewWindowOpen] = useState(false)\n\n const style = useMemo(\n () => ({\n ...(fixedWidth\n ? {\n width: `${fixedWidth}px`\n }\n : {}),\n ...(hasDarkMode\n ? {\n backgroundColor: args.isLight ? THEME.color.gainsboro : THEME.color.white\n }\n : {})\n }),\n [args.isLight]\n )\n\n const { forceUpdate } = useForceUpdate()\n\n useEffect(() => {\n forceUpdate()\n }, [forceUpdate])\n\n return (\n <>\n {withNewWindowButton && (\n \n \n \n )}\n\n {!isNewWindowOpen && (\n \n \n \n )}\n\n {withNewWindowButton && isNewWindowOpen && (\n setIsNewWindowOpen(false)}>\n \n \n )}\n \n )\n }\n}\n\nfunction NewWindowStoryWrapperWithRef(\n { Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs },\n ref: ForwardedRef\n) {\n // eslint-disable-next-line no-null/no-null\n const wrapperRef = useRef(null)\n\n const [isFirstRender, setIsFirstRender] = useState(true)\n\n useImperativeHandle(ref, () => wrapperRef.current)\n\n const newWindowContextProviderValue: NewWindowContextValue = useMemo(\n () => ({\n newWindowContainerRef: wrapperRef.current\n ? (wrapperRef as MutableRefObject)\n : { current: window.document.createElement('div') }\n }),\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isFirstRender]\n )\n\n useEffect(() => {\n setIsFirstRender(false)\n }, [])\n\n return (\n \n {!isFirstRender && (\n \n \n \n \n \n )}\n \n )\n}\n\nconst NewWindowStoryWrapper = forwardRef(NewWindowStoryWrapperWithRef)\n\nfunction NewWindowStory({ Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs }) {\n const { newWindowContainerRef } = useNewWindow()\n\n return \n}\n\nconst StoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n\nconst NewWindowButtonBox = styled.div`\n position: fixed;\n right: 16px;\n top: 16px;\n`\nconst NewWindowStoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js b/tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js similarity index 98% rename from tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js rename to tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js index 588c51851..6a93d4311 100644 --- a/tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js +++ b/tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js @@ -10,7 +10,7 @@ height: 100%; padding: 16px; width: 100%; -`;try{generateStoryDecorator.displayName="generateStoryDecorator",generateStoryDecorator.__docgenInfo={description:"",displayName:"generateStoryDecorator",props:{fixedWidth:{defaultValue:null,description:"",name:"fixedWidth",required:!1,type:{name:"number"}},hasDarkMode:{defaultValue:{value:"false"},description:"",name:"hasDarkMode",required:!1,type:{name:"boolean"}},withNewWindowButton:{defaultValue:{value:"false"},description:"",name:"withNewWindowButton",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES[".storybook/components/StoryDecorator.tsx#generateStoryDecorator"]={docgenInfo:generateStoryDecorator.__docgenInfo,name:"generateStoryDecorator",path:".storybook/components/StoryDecorator.tsx#generateStoryDecorator"})}catch(__react_docgen_typescript_loader_error){}},"./stories/tables/TableWithSelectableRows.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{_TableWithSelectableRows:()=>_TableWithSelectableRows,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@tanstack/react-table/build/lib/index.mjs"),_tanstack_react_table__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@tanstack/table-core/build/lib/index.mjs"),_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@tanstack/react-virtual/build/lib/index.mjs"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),styled_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/styled-components/dist/styled-components.browser.esm.js"),_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./.storybook/components/StoryDecorator.tsx"),_src__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/index.ts"),_src_icons__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/icons/index.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const data=[...Array(100).fill({id:4,reportingId:2300004,sourceType:"SEMAPHORE",semaphoreId:33,controlUnitId:null,sourceName:null,displayedSource:"Sémaphore de Boulogne sur mer",targetType:null,vehicleType:null,targetDetails:[],geom:{type:"MultiPolygon",coordinates:[[[[-19.00097037,49.57813235],[-14.5054498,50.48083701],[-14.25087621,49.53018118],[-19.00097037,49.57813235]]]]},seaFront:"MED",description:null,reportType:"INFRACTION_SUSPICION",theme:null,subThemes:[],actionTaken:null,isInfractionProven:!1,isControlRequired:!1,isUnitAvailable:null,createdAt:"2023-08-04T15:13:43.296Z",validityTime:1,isArchived:!1}),...Array(100).fill({id:1,reportingId:2300001,sourceType:"SEMAPHORE",semaphoreId:21,controlUnitId:null,sourceName:null,displayedSource:"SEMAPHORE LE TOULINGUET",targetType:"VEHICLE",vehicleType:"VESSEL",targetDetails:[{mmsi:"012314231343",imo:null,externalReferenceNumber:null,vesselName:"Vessel 1",operatorName:null,size:null}],geom:{type:"MultiPoint",coordinates:[[-4.93888188,48.41495669]]},seaFront:"NAMO",description:"Description 1",reportType:"OBSERVATION",theme:"Rejets illicites",subThemes:["Jet de déchet","Carénage sauvage"],actionTaken:"ACTION TAKEN",isInfractionProven:!0,isControlRequired:!0,isUnitAvailable:!0,createdAt:"2023-08-01T15:13:01.073587Z",validityTime:24,isArchived:!0})],__WEBPACK_DEFAULT_EXPORT__={title:"Tables/TableWithSelectableRows",decorators:[(0,_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__.N)()]},ButtonsGroupRow=({id,onSelect})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(ButtonsGroup,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.TERTIARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Duplicate,onClick:()=>console.log(id)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.TERTIARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Edit,onClick:()=>console.log(id)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.Lt,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.More,onSelect,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Lt.Item,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,eventKey:"ARCHIVE",Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Archive}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Lt.Item,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,eventKey:"DELETE",Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Delete})]})]});function _TableWithSelectableRows(){const[rowSelection,setRowSelection]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),[sorting,setSorting]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([{id:"createdAt",desc:!1}]),columns=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>[{id:"select",size:25,enableSorting:!1,accessorFn:row=>row.reportingId,header:({table})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.RowCheckbox,{isChecked:table.getIsAllRowsSelected(),isIndeterminate:table.getIsSomeRowsSelected(),onChange:table.getToggleAllRowsSelectedHandler()}),cell:({row})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.RowCheckbox,{disabled:!row.getCanSelect(),isChecked:row.getIsSelected(),onChange:row.getToggleSelectedHandler(row)})},{accessorFn:row=>row.reportingId,cell:info=>info.getValue(),enableSorting:!1,header:()=>"",id:"reportingId",size:80},{accessorFn:row=>row.createdAt,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Ouverture",id:"createdAt",size:105},{accessorFn:row=>row.validityTime,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Fin dans",id:"validityTime",size:75},{accessorFn:row=>row.displayedSource,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Source",id:"displayedSource",size:180},{accessorFn:row=>row.reportType,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Type",id:"reportType",size:120},{accessorFn:row=>row,cell:({row})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("span",{children:[row.original.theme,": ",row.original.subThemes?row.original.subThemes.join(", "):""]}),enableSorting:!0,header:()=>"Thématique",id:"theme",size:165},{accessorFn:row=>row.seaFront,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Façade",id:"seaFront",size:90},{accessorFn:row=>row.status,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Statut",id:"isArchived",size:70},{accessorFn:row=>row.missionId,cell:()=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Vp,{backgroundColor:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.mediumSeaGreen,color:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.white,Icon:_src_icons__WEBPACK_IMPORTED_MODULE_3__.Link,children:"Mission"}),enableSorting:!1,header:()=>"",id:"missionId",size:85},{accessorFn:row=>row.geom,cell:()=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Vp,{backgroundColor:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.gainsboro,iconColor:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.goldenPoppy,withBullet:!0,children:"Ctl fait"}),enableSorting:!1,header:()=>"",id:"actionStatus",size:85},{accessorFn:row=>row.geom,cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.TERTIARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.FocusZones,onClick:()=>console.log(info.getValue())}),enableSorting:!1,header:()=>"",id:"geom",size:55},{accessorFn:row=>row.id,cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ButtonsGroupRow,{id:info.getValue(),onSelect:key=>((key,id)=>{"ARCHIVE"===key?console.log("we want to archive the reporting with id: ",id):console.log("we want to delete the reporting with id: ",id)})(key,info.getValue())}),enableSorting:!1,header:()=>"",id:"id",size:120}]),[]),table=(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.b7)({columns,data,state:{sorting,rowSelection},enableRowSelection:!0,enableSortingRemoval:!1,enableColumnResizing:!1,onRowSelectionChange:rowId=>{setRowSelection(rowId)},onSortingChange:setSorting,getCoreRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_6__.sC)(),getSortedRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_6__.tj)()}),selectedIds=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>table.getSelectedRowModel().rows.map((({original})=>original.id))),[rowSelection]),tableContainerRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),{rows}=table.getRowModel(),rowVirtualizer=(0,_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_7__.MG)({count:rows.length,getScrollElement:()=>tableContainerRef.current,estimateSize:()=>10,overscan:10,getItemKey:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((index=>`${rows[index]?.id}`),[rows])}),virtualRows=rowVirtualizer.getVirtualItems(),[paddingTop,paddingBottom]=virtualRows.length>0?[Math.max(0,virtualRows[0]?.start||0),Math.max(0,rowVirtualizer.getTotalSize()-(virtualRows[virtualRows.length-1]?.end||0))]:[0,0];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Archive,onClick:()=>{console.log("this reportings will be archived: ",selectedIds)}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{ref:tableContainerRef,style:{width:1776},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Table,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Head,{children:table.getHeaderGroups().map((headerGroup=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("tr",{children:headerGroup.headers.map((header=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Th,{$width:header.column.getSize(),children:header.isPlaceholder?void 0:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.SortContainer,{className:header.column.getCanSort()?"cursor-pointer":"",onClick:header.column.getToggleSortingHandler(),children:[(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.ie)(header.column.columnDef.header,header.getContext()),header.column.getCanSort()&&({asc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{children:"▲"}),desc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{children:"▼"})}[header.column.getIsSorted()]??(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.JO.SortingArrows,{size:14}))]})},header.id)))},headerGroup.id)))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("tbody",{children:[paddingTop>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("td",{style:{height:`${paddingTop}px`}})}),virtualRows.map(((virtualRow,index)=>{const row=rows[virtualRow.index];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.BodyTr,{$isHighlighted:index%2==0,children:row?.getVisibleCells().map((cell=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Td,{$hasRightBorder:!("geom"!==cell.column.id),$isCenter:!("geom"!==cell.column.id&&"id"!==cell.column.id),$isHighlighted:index%2==0,$width:cell.column.getSize(),children:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.ie)(cell.column.columnDef.cell,cell.getContext())},cell.id)))},virtualRow.key)})),paddingBottom>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("td",{style:{height:`${paddingBottom}px`}})})]})]})})]})}ButtonsGroupRow.displayName="ButtonsGroupRow";const ButtonsGroup=styled_components__WEBPACK_IMPORTED_MODULE_8__.ZP.div` +`;try{generateStoryDecorator.displayName="generateStoryDecorator",generateStoryDecorator.__docgenInfo={description:"",displayName:"generateStoryDecorator",props:{fixedWidth:{defaultValue:null,description:"",name:"fixedWidth",required:!1,type:{name:"number"}},hasDarkMode:{defaultValue:{value:"false"},description:"",name:"hasDarkMode",required:!1,type:{name:"boolean"}},withNewWindowButton:{defaultValue:{value:"false"},description:"",name:"withNewWindowButton",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES[".storybook/components/StoryDecorator.tsx#generateStoryDecorator"]={docgenInfo:generateStoryDecorator.__docgenInfo,name:"generateStoryDecorator",path:".storybook/components/StoryDecorator.tsx#generateStoryDecorator"})}catch(__react_docgen_typescript_loader_error){}},"./stories/tables/TableWithSelectableRows.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{_TableWithSelectableRows:()=>_TableWithSelectableRows,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@tanstack/react-table/build/lib/index.mjs"),_tanstack_react_table__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@tanstack/table-core/build/lib/index.mjs"),_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@tanstack/react-virtual/build/lib/index.mjs"),react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),styled_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/styled-components/dist/styled-components.browser.esm.js"),_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./.storybook/components/StoryDecorator.tsx"),_src__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/index.ts"),_src_icons__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/icons/index.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const data=[...Array(100).fill({id:4,reportingId:2300004,sourceType:"SEMAPHORE",semaphoreId:33,controlUnitId:null,sourceName:null,displayedSource:"Sémaphore de Boulogne sur mer",targetType:null,vehicleType:null,targetDetails:[],geom:{type:"MultiPolygon",coordinates:[[[[-19.00097037,49.57813235],[-14.5054498,50.48083701],[-14.25087621,49.53018118],[-19.00097037,49.57813235]]]]},seaFront:"MED",description:null,reportType:"INFRACTION_SUSPICION",theme:null,subThemes:[],actionTaken:null,isInfractionProven:!1,isControlRequired:!1,isUnitAvailable:null,createdAt:"2023-08-04T15:13:43.296Z",validityTime:1,isArchived:!1}),...Array(100).fill({id:1,reportingId:2300001,sourceType:"SEMAPHORE",semaphoreId:21,controlUnitId:null,sourceName:null,displayedSource:"SEMAPHORE LE TOULINGUET",targetType:"VEHICLE",vehicleType:"VESSEL",targetDetails:[{mmsi:"012314231343",imo:null,externalReferenceNumber:null,vesselName:"Vessel 1",operatorName:null,size:null}],geom:{type:"MultiPoint",coordinates:[[-4.93888188,48.41495669]]},seaFront:"NAMO",description:"Description 1",reportType:"OBSERVATION",theme:"Rejets illicites",subThemes:["Jet de déchet","Carénage sauvage"],actionTaken:"ACTION TAKEN",isInfractionProven:!0,isControlRequired:!0,isUnitAvailable:!0,createdAt:"2023-08-01T15:13:01.073587Z",validityTime:24,isArchived:!0})],__WEBPACK_DEFAULT_EXPORT__={title:"Tables/TableWithSelectableRows",decorators:[(0,_storybook_components_StoryDecorator__WEBPACK_IMPORTED_MODULE_1__.N)()]},ButtonsGroupRow=({id,onSelect})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(ButtonsGroup,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.TERTIARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Duplicate,onClick:()=>console.log(id)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.TERTIARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Edit,onClick:()=>console.log(id)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.Lt,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.More,onSelect,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Lt.Item,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,eventKey:"ARCHIVE",Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Archive}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Lt.Item,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,eventKey:"DELETE",Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Delete})]})]});function _TableWithSelectableRows(){const[rowSelection,setRowSelection]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),[sorting,setSorting]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([{id:"createdAt",desc:!1}]),columns=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>[{id:"select",size:25,enableSorting:!1,accessorFn:row=>row.reportingId,header:({table})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.RowCheckbox,{isChecked:table.getIsAllRowsSelected(),isIndeterminate:table.getIsSomeRowsSelected(),onChange:table.getToggleAllRowsSelectedHandler()}),cell:({row})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.RowCheckbox,{disabled:!row.getCanSelect(),isChecked:row.getIsSelected(),onChange:row.getToggleSelectedHandler(row)})},{accessorFn:row=>row.reportingId,cell:info=>info.getValue(),enableSorting:!1,header:()=>"",id:"reportingId",size:80},{accessorFn:row=>row.createdAt,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Ouverture",id:"createdAt",size:105},{accessorFn:row=>row.validityTime,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Fin dans",id:"validityTime",size:75},{accessorFn:row=>row.displayedSource,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Source",id:"displayedSource",size:180},{accessorFn:row=>row.reportType,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Type",id:"reportType",size:120},{accessorFn:row=>row,cell:({row})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("span",{children:[row.original.theme,": ",row.original.subThemes?row.original.subThemes.join(", "):""]}),enableSorting:!0,header:()=>"Thématique",id:"theme",size:165},{accessorFn:row=>row.seaFront,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Façade",id:"seaFront",size:90},{accessorFn:row=>row.status,cell:info=>info.getValue(),enableSorting:!0,header:()=>"Statut",id:"isArchived",size:70},{accessorFn:row=>row.missionId,cell:()=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Vp,{backgroundColor:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.mediumSeaGreen,color:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.white,Icon:_src_icons__WEBPACK_IMPORTED_MODULE_3__.Link,children:"Mission"}),enableSorting:!1,header:()=>"",id:"missionId",size:85},{accessorFn:row=>row.geom,cell:()=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.Vp,{backgroundColor:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.gainsboro,iconColor:_src__WEBPACK_IMPORTED_MODULE_2__.C6.color.goldenPoppy,withBullet:!0,children:"Ctl fait"}),enableSorting:!1,header:()=>"",id:"actionStatus",size:85},{accessorFn:row=>row.geom,cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.TERTIARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.FocusZones,onClick:()=>console.log(info.getValue())}),enableSorting:!1,header:()=>"",id:"geom",size:55},{accessorFn:row=>row.id,cell:info=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ButtonsGroupRow,{id:info.getValue(),onSelect:key=>((key,id)=>{"ARCHIVE"===key?console.log("we want to archive the reporting with id: ",id):console.log("we want to delete the reporting with id: ",id)})(key,info.getValue())}),enableSorting:!1,header:()=>"",id:"id",size:120}]),[]),table=(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.b7)({columns,data,state:{sorting,rowSelection},enableRowSelection:!0,enableSortingRemoval:!1,enableColumnResizing:!1,onRowSelectionChange:rowId=>{setRowSelection(rowId)},onSortingChange:setSorting,getCoreRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_6__.sC)(),getSortedRowModel:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_6__.tj)()}),selectedIds=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>table.getSelectedRowModel().rows.map((({original})=>original.id))),[rowSelection]),tableContainerRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),{rows}=table.getRowModel(),rowVirtualizer=(0,_tanstack_react_virtual__WEBPACK_IMPORTED_MODULE_7__.MG)({count:rows.length,getScrollElement:()=>tableContainerRef.current,estimateSize:()=>10,overscan:10,getItemKey:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((index=>`${rows[index]?.id}`),[rows])}),virtualRows=rowVirtualizer.getVirtualItems(),[paddingTop,paddingBottom]=virtualRows.length>0?[Math.max(0,virtualRows[0]?.start??0),Math.max(0,rowVirtualizer.getTotalSize()-(virtualRows[virtualRows.length-1]?.end??0))]:[0,0];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.hU,{accent:_src__WEBPACK_IMPORTED_MODULE_2__.Le.SECONDARY,Icon:_src__WEBPACK_IMPORTED_MODULE_2__.JO.Archive,onClick:()=>{console.log("this reportings will be archived: ",selectedIds)}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{ref:tableContainerRef,style:{width:1776},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Table,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Head,{children:table.getHeaderGroups().map((headerGroup=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("tr",{children:headerGroup.headers.map((header=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Th,{$width:header.column.getSize(),children:header.isPlaceholder?void 0:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.SortContainer,{className:header.column.getCanSort()?"cursor-pointer":"",onClick:header.column.getToggleSortingHandler(),children:[(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.ie)(header.column.columnDef.header,header.getContext()),header.column.getCanSort()&&({asc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{children:"▲"}),desc:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{children:"▼"})}[header.column.getIsSorted()]??(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.JO.SortingArrows,{size:14}))]})},header.id)))},headerGroup.id)))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("tbody",{children:[paddingTop>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("td",{style:{height:`${paddingTop}px`}})}),virtualRows.map(((virtualRow,index)=>{const row=rows[virtualRow.index];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.BodyTr,{$isHighlighted:index%2==0,children:row?.getVisibleCells().map((cell=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_src__WEBPACK_IMPORTED_MODULE_2__.P$.Td,{$hasRightBorder:!("geom"!==cell.column.id),$isCenter:!("geom"!==cell.column.id&&"id"!==cell.column.id),$isHighlighted:index%2==0,$width:cell.column.getSize(),children:(0,_tanstack_react_table__WEBPACK_IMPORTED_MODULE_5__.ie)(cell.column.columnDef.cell,cell.getContext())},cell.id)))},virtualRow.key)})),paddingBottom>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("tr",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("td",{style:{height:`${paddingBottom}px`}})})]})]})})]})}ButtonsGroupRow.displayName="ButtonsGroupRow";const ButtonsGroup=styled_components__WEBPACK_IMPORTED_MODULE_8__.ZP.div` display: flex; flex-direction: row; gap: 8px; @@ -18,5 +18,5 @@ > button { padding: 0px; } -`;_TableWithSelectableRows.parameters={..._TableWithSelectableRows.parameters,docs:{..._TableWithSelectableRows.parameters?.docs,source:{originalSource:"function _TableWithSelectableRows() {\n const [rowSelection, setRowSelection] = useState({});\n const [sorting, setSorting] = useState([{\n id: 'createdAt',\n desc: false\n }]);\n const doAction = (key, id) => {\n if (key === 'ARCHIVE') {\n console.log('we want to archive the reporting with id: ', id);\n } else {\n console.log('we want to delete the reporting with id: ', id);\n }\n };\n const columns = useMemo(() => [{\n id: 'select',\n size: 25,\n enableSorting: false,\n accessorFn: row => row.reportingId,\n header: ({\n table\n }) => ,\n cell: ({\n row\n }) => \n }, {\n accessorFn: row => row.reportingId,\n cell: info => info.getValue(),\n enableSorting: false,\n header: () => '',\n id: 'reportingId',\n size: 80\n }, {\n accessorFn: row => row.createdAt,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Ouverture',\n id: 'createdAt',\n size: 105\n }, {\n accessorFn: row => row.validityTime,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Fin dans',\n id: 'validityTime',\n size: 75\n }, {\n accessorFn: row => row.displayedSource,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Source',\n id: 'displayedSource',\n size: 180\n }, {\n accessorFn: row => row.reportType,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Type',\n id: 'reportType',\n size: 120\n }, {\n accessorFn: row => row,\n cell: ({\n row\n }) => \n {row.original.theme}: {row.original.subThemes ? row.original.subThemes.join(', ') : ''}\n ,\n enableSorting: true,\n header: () => 'Thématique',\n id: 'theme',\n size: 165\n }, {\n accessorFn: row => row.seaFront,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Façade',\n id: 'seaFront',\n size: 90\n }, {\n accessorFn: row => row.status,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Statut',\n id: 'isArchived',\n size: 70\n }, {\n accessorFn: row => row.missionId,\n cell: () => \n Mission\n ,\n enableSorting: false,\n header: () => '',\n id: 'missionId',\n size: 85\n }, {\n accessorFn: row => row.geom,\n cell: () => \n Ctl fait\n ,\n enableSorting: false,\n header: () => '',\n id: 'actionStatus',\n size: 85\n }, {\n accessorFn: row => row.geom,\n cell: info => console.log(info.getValue())} />,\n enableSorting: false,\n header: () => '',\n id: 'geom',\n size: 55\n }, {\n accessorFn: row => row.id,\n cell: info => doAction(key, info.getValue())} />,\n enableSorting: false,\n header: () => '',\n id: 'id',\n size: 120\n }], []);\n const table = useReactTable({\n columns,\n data,\n state: {\n sorting,\n rowSelection\n },\n enableRowSelection: true,\n enableSortingRemoval: false,\n enableColumnResizing: false,\n onRowSelectionChange: rowId => {\n setRowSelection(rowId);\n },\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel()\n });\n const selectedIds = useMemo(() => table.getSelectedRowModel().rows.map(({\n original\n }) => original.id),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [rowSelection]);\n\n // eslint-disable-next-line no-null/no-null\n const tableContainerRef = useRef(null);\n const {\n rows\n } = table.getRowModel();\n const rowVirtualizer = useVirtualizer({\n count: rows.length,\n getScrollElement: () => tableContainerRef.current,\n estimateSize: () => 10,\n overscan: 10,\n // Pass correct keys to virtualizer it's important when rows change position\n getItemKey: useCallback((index: number) => `${rows[index]?.id}`, [rows])\n });\n const virtualRows = rowVirtualizer.getVirtualItems();\n const [paddingTop, paddingBottom] = virtualRows.length > 0 ? [Math.max(0, virtualRows[0]?.start || 0), Math.max(0, rowVirtualizer.getTotalSize() - (virtualRows[virtualRows.length - 1]?.end || 0))] : [0, 0];\n const archiveReportings = () => {\n // eslint-disable-next-line no-console\n console.log('this reportings will be archived: ', selectedIds);\n };\n return <>\n
\n \n
\n
\n \n \n {table.getHeaderGroups().map(headerGroup => \n {headerGroup.headers.map(header => \n {header.isPlaceholder ? undefined : \n {flexRender(header.column.columnDef.header, header.getContext())}\n {header.column.getCanSort() && ({\n asc:
,\n desc:
\n }[(header.column.getIsSorted() as string)] ?? )}\n
}\n
)}\n )}\n
\n \n {paddingTop > 0 && \n \n }\n {virtualRows.map((virtualRow, index) => {\n const row = rows[virtualRow.index];\n return \n {row?.getVisibleCells().map(cell => \n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n )}\n ;\n })}\n {paddingBottom > 0 && \n \n }\n \n
\n
\n ;\n}",..._TableWithSelectableRows.parameters?.docs?.source}}};const __namedExportsOrder=["_TableWithSelectableRows"]}}]); -//# sourceMappingURL=tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js.map \ No newline at end of file +`;_TableWithSelectableRows.parameters={..._TableWithSelectableRows.parameters,docs:{..._TableWithSelectableRows.parameters?.docs,source:{originalSource:"function _TableWithSelectableRows() {\n const [rowSelection, setRowSelection] = useState({});\n const [sorting, setSorting] = useState([{\n id: 'createdAt',\n desc: false\n }]);\n const doAction = (key, id) => {\n if (key === 'ARCHIVE') {\n console.log('we want to archive the reporting with id: ', id);\n } else {\n console.log('we want to delete the reporting with id: ', id);\n }\n };\n const columns = useMemo(() => [{\n id: 'select',\n size: 25,\n enableSorting: false,\n accessorFn: row => row.reportingId,\n header: ({\n table\n }) => ,\n cell: ({\n row\n }) => \n }, {\n accessorFn: row => row.reportingId,\n cell: info => info.getValue(),\n enableSorting: false,\n header: () => '',\n id: 'reportingId',\n size: 80\n }, {\n accessorFn: row => row.createdAt,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Ouverture',\n id: 'createdAt',\n size: 105\n }, {\n accessorFn: row => row.validityTime,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Fin dans',\n id: 'validityTime',\n size: 75\n }, {\n accessorFn: row => row.displayedSource,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Source',\n id: 'displayedSource',\n size: 180\n }, {\n accessorFn: row => row.reportType,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Type',\n id: 'reportType',\n size: 120\n }, {\n accessorFn: row => row,\n cell: ({\n row\n }) => \n {row.original.theme}: {row.original.subThemes ? row.original.subThemes.join(', ') : ''}\n ,\n enableSorting: true,\n header: () => 'Thématique',\n id: 'theme',\n size: 165\n }, {\n accessorFn: row => row.seaFront,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Façade',\n id: 'seaFront',\n size: 90\n }, {\n accessorFn: row => row.status,\n cell: info => info.getValue(),\n enableSorting: true,\n header: () => 'Statut',\n id: 'isArchived',\n size: 70\n }, {\n accessorFn: row => row.missionId,\n cell: () => \n Mission\n ,\n enableSorting: false,\n header: () => '',\n id: 'missionId',\n size: 85\n }, {\n accessorFn: row => row.geom,\n cell: () => \n Ctl fait\n ,\n enableSorting: false,\n header: () => '',\n id: 'actionStatus',\n size: 85\n }, {\n accessorFn: row => row.geom,\n cell: info => console.log(info.getValue())} />,\n enableSorting: false,\n header: () => '',\n id: 'geom',\n size: 55\n }, {\n accessorFn: row => row.id,\n cell: info => doAction(key, info.getValue())} />,\n enableSorting: false,\n header: () => '',\n id: 'id',\n size: 120\n }], []);\n const table = useReactTable({\n columns,\n data,\n state: {\n sorting,\n rowSelection\n },\n enableRowSelection: true,\n enableSortingRemoval: false,\n enableColumnResizing: false,\n onRowSelectionChange: rowId => {\n setRowSelection(rowId);\n },\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel()\n });\n const selectedIds = useMemo(() => table.getSelectedRowModel().rows.map(({\n original\n }) => original.id),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [rowSelection]);\n\n // eslint-disable-next-line no-null/no-null\n const tableContainerRef = useRef(null);\n const {\n rows\n } = table.getRowModel();\n const rowVirtualizer = useVirtualizer({\n count: rows.length,\n getScrollElement: () => tableContainerRef.current,\n estimateSize: () => 10,\n overscan: 10,\n // Pass correct keys to virtualizer it's important when rows change position\n getItemKey: useCallback((index: number) => `${rows[index]?.id}`, [rows])\n });\n const virtualRows = rowVirtualizer.getVirtualItems();\n const [paddingTop, paddingBottom] = virtualRows.length > 0 ? [Math.max(0, virtualRows[0]?.start ?? 0), Math.max(0, rowVirtualizer.getTotalSize() - (virtualRows[virtualRows.length - 1]?.end ?? 0))] : [0, 0];\n const archiveReportings = () => {\n // eslint-disable-next-line no-console\n console.log('this reportings will be archived: ', selectedIds);\n };\n return <>\n
\n \n
\n
\n \n \n {table.getHeaderGroups().map(headerGroup => \n {headerGroup.headers.map(header => \n {header.isPlaceholder ? undefined : \n {flexRender(header.column.columnDef.header, header.getContext())}\n {header.column.getCanSort() && ({\n asc:
,\n desc:
\n }[(header.column.getIsSorted() as string)] ?? )}\n
}\n
)}\n )}\n
\n \n {paddingTop > 0 && \n \n }\n {virtualRows.map((virtualRow, index) => {\n const row = rows[virtualRow.index];\n return \n {row?.getVisibleCells().map(cell => \n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n )}\n ;\n })}\n {paddingBottom > 0 && \n \n }\n \n
\n
\n ;\n}",..._TableWithSelectableRows.parameters?.docs?.source}}};const __namedExportsOrder=["_TableWithSelectableRows"]}}]); +//# sourceMappingURL=tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js.map \ No newline at end of file diff --git a/tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js.map b/tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js.map similarity index 96% rename from tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js.map rename to tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js.map index d3e9f23c6..828dc2bec 100644 --- a/tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js.map +++ b/tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"tables-TableWithSelectableRows-stories.d03a9788.iframe.bundle.js","mappings":";;;;AA6HA;;;;AAKA","sources":["webpack://@mtes-mct/monitor-ui__root/./.storybook/components/StoryDecorator.tsx"],"sourcesContent":["import { forwardRef, useEffect, useImperativeHandle, useMemo, useState, useRef } from 'react'\nimport styled from 'styled-components'\n\nimport { GlobalDecoratorWrapper } from './GlobalDecorator'\nimport { Accent, Button, NewWindow, Size, THEME, useForceUpdate, useNewWindow, NewWindowContext } from '../../src'\n\nimport type { NewWindowContextValue } from '../../src'\nimport type { StoryContext, StoryFn, StrictArgs } from '@storybook/react'\nimport type { ForwardedRef, MutableRefObject } from 'react'\n\nexport function generateStoryDecorator({\n fixedWidth,\n hasDarkMode = false,\n withNewWindowButton = false\n}: {\n fixedWidth?: number\n hasDarkMode?: boolean\n withNewWindowButton?: boolean\n} = {}) {\n return function StoryDecorator(Story: StoryFn, { args }: StoryContext) {\n const newWindowRef = useRef() as MutableRefObject\n\n const [isNewWindowOpen, setIsNewWindowOpen] = useState(false)\n\n const style = useMemo(\n () => ({\n ...(fixedWidth\n ? {\n width: `${fixedWidth}px`\n }\n : {}),\n ...(hasDarkMode\n ? {\n backgroundColor: args.isLight ? THEME.color.gainsboro : THEME.color.white\n }\n : {})\n }),\n [args.isLight]\n )\n\n const { forceUpdate } = useForceUpdate()\n\n useEffect(() => {\n forceUpdate()\n }, [forceUpdate])\n\n return (\n <>\n {withNewWindowButton && (\n \n \n \n )}\n\n {!isNewWindowOpen && (\n \n \n \n )}\n\n {withNewWindowButton && isNewWindowOpen && (\n setIsNewWindowOpen(false)}>\n \n \n )}\n \n )\n }\n}\n\nfunction NewWindowStoryWrapperWithRef(\n { Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs },\n ref: ForwardedRef\n) {\n // eslint-disable-next-line no-null/no-null\n const wrapperRef = useRef(null)\n\n const [isFirstRender, setIsFirstRender] = useState(true)\n\n useImperativeHandle(ref, () => wrapperRef.current)\n\n const newWindowContextProviderValue: NewWindowContextValue = useMemo(\n () => ({\n newWindowContainerRef: wrapperRef.current\n ? (wrapperRef as MutableRefObject)\n : { current: window.document.createElement('div') }\n }),\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isFirstRender]\n )\n\n useEffect(() => {\n setIsFirstRender(false)\n }, [])\n\n return (\n \n {!isFirstRender && (\n \n \n \n \n \n )}\n \n )\n}\n\nconst NewWindowStoryWrapper = forwardRef(NewWindowStoryWrapperWithRef)\n\nfunction NewWindowStory({ Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs }) {\n const { newWindowContainerRef } = useNewWindow()\n\n return \n}\n\nconst StoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n\nconst NewWindowButtonBox = styled.div`\n position: fixed;\n right: 16px;\n top: 16px;\n`\nconst NewWindowStoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"tables-TableWithSelectableRows-stories.50882eda.iframe.bundle.js","mappings":";;;;AA6HA;;;;AAKA","sources":["webpack://@mtes-mct/monitor-ui__root/./.storybook/components/StoryDecorator.tsx"],"sourcesContent":["import { forwardRef, useEffect, useImperativeHandle, useMemo, useState, useRef } from 'react'\nimport styled from 'styled-components'\n\nimport { GlobalDecoratorWrapper } from './GlobalDecorator'\nimport { Accent, Button, NewWindow, Size, THEME, useForceUpdate, useNewWindow, NewWindowContext } from '../../src'\n\nimport type { NewWindowContextValue } from '../../src'\nimport type { StoryContext, StoryFn, StrictArgs } from '@storybook/react'\nimport type { ForwardedRef, MutableRefObject } from 'react'\n\nexport function generateStoryDecorator({\n fixedWidth,\n hasDarkMode = false,\n withNewWindowButton = false\n}: {\n fixedWidth?: number\n hasDarkMode?: boolean\n withNewWindowButton?: boolean\n} = {}) {\n return function StoryDecorator(Story: StoryFn, { args }: StoryContext) {\n const newWindowRef = useRef() as MutableRefObject\n\n const [isNewWindowOpen, setIsNewWindowOpen] = useState(false)\n\n const style = useMemo(\n () => ({\n ...(fixedWidth\n ? {\n width: `${fixedWidth}px`\n }\n : {}),\n ...(hasDarkMode\n ? {\n backgroundColor: args.isLight ? THEME.color.gainsboro : THEME.color.white\n }\n : {})\n }),\n [args.isLight]\n )\n\n const { forceUpdate } = useForceUpdate()\n\n useEffect(() => {\n forceUpdate()\n }, [forceUpdate])\n\n return (\n <>\n {withNewWindowButton && (\n \n \n \n )}\n\n {!isNewWindowOpen && (\n \n \n \n )}\n\n {withNewWindowButton && isNewWindowOpen && (\n setIsNewWindowOpen(false)}>\n \n \n )}\n \n )\n }\n}\n\nfunction NewWindowStoryWrapperWithRef(\n { Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs },\n ref: ForwardedRef\n) {\n // eslint-disable-next-line no-null/no-null\n const wrapperRef = useRef(null)\n\n const [isFirstRender, setIsFirstRender] = useState(true)\n\n useImperativeHandle(ref, () => wrapperRef.current)\n\n const newWindowContextProviderValue: NewWindowContextValue = useMemo(\n () => ({\n newWindowContainerRef: wrapperRef.current\n ? (wrapperRef as MutableRefObject)\n : { current: window.document.createElement('div') }\n }),\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isFirstRender]\n )\n\n useEffect(() => {\n setIsFirstRender(false)\n }, [])\n\n return (\n \n {!isFirstRender && (\n \n \n \n \n \n )}\n \n )\n}\n\nconst NewWindowStoryWrapper = forwardRef(NewWindowStoryWrapperWithRef)\n\nfunction NewWindowStory({ Story, storyArgs }: { Story: StoryFn; storyArgs: StrictArgs }) {\n const { newWindowContainerRef } = useNewWindow()\n\n return \n}\n\nconst StoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n\nconst NewWindowButtonBox = styled.div`\n position: fixed;\n right: 16px;\n top: 16px;\n`\nconst NewWindowStoryBox = styled.div`\n height: 100%;\n padding: 16px;\n width: 100%;\n`\n"],"names":[],"sourceRoot":""} \ No newline at end of file