{"version":3,"sources":["services/api.ts","components/SummaryCard/index.tsx","shared/toast.ts","hooks/useAlert.ts","shared/roles.ts","hooks/useDebouncedState.ts","components/SummaryDataChartCard/index.tsx","contexts/AlertContext.tsx","contexts/ModalContext.tsx","components/FallbackSpinner/index.tsx","contexts/SidebarContext.tsx","styles/theme/config.ts","assets/img/symbol.png","shared/env.ts","components/OwnSelect/components/DropdownIndicator.tsx","components/OwnSelect/components/LoadingIndicator.tsx","components/OwnSelect/index.tsx","components/Loader/styles.ts","components/Loader/index.tsx","components/Pagination/index.tsx","hooks/useThrottledState.ts","components/AppTable/index.tsx","services/axios.ts","hooks/useCookies.ts","hooks/useAuth.ts","contexts/AuthContext.tsx","components/Modal/BudgetCompositionEdit/index.tsx","routes/index.tsx","components/Alert/Root/alertList.ts","components/Alert/Generic/index.tsx","components/Alert/DangerDelete/index.tsx","components/Alert/Root/index.tsx","components/Modal/ABCValues/index.tsx","components/Modal/BaseAdd/index.tsx","components/Modal/BaseSelect/index.tsx","components/Modal/BudgetComponentObservation/index.tsx","components/Modal/BudgetCompositionEdit/FragmentsTableRow.tsx","components/Modal/BudgetCompositionEdit/FragmentsTable.tsx","components/Modal/BudgetCompositionFragmentSelect/SearchFilter.tsx","components/Modal/BudgetCompositionFragmentSelect/index.tsx","components/Modal/BudgetCompositionLookup/FragmentsTableRow.tsx","components/Modal/BudgetCompositionLookup/FragmentsTable.tsx","components/Modal/BudgetCompositionLookup/index.tsx","components/Modal/BudgetCompositionSelect/SearchFilter.tsx","components/Modal/BudgetCompositionSelect/index.tsx","components/Modal/BudgetCustomCompositionAdd/Form.tsx","components/Modal/BudgetCustomCompositionAdd/index.tsx","components/Modal/BudgetGlobalPriceChange/index.tsx","components/Modal/BudgetHistory/StatusBadge.tsx","components/Modal/BudgetHistory/index.tsx","components/Modal/BudgetInputFragmentSelect/SearchFilter.tsx","components/Modal/BudgetInputFragmentSelect/index.tsx","components/Modal/BudgetInputSelect/SearchFilter.tsx","components/Modal/BudgetInputSelect/index.tsx","components/Modal/BudgetOutdatedComponentSelect/CompositionRow.tsx","components/Modal/BudgetOutdatedComponentSelect/InputRow.tsx","components/Modal/BudgetOutdatedComponentSelect/OutdatedComponentsTableBody.tsx","components/Modal/BudgetOutdatedComponentSelect/OutdatedComponentsTable.tsx","components/Modal/BudgetOutdatedComponentSelect/index.tsx","components/Modal/ClientLookup/index.tsx","components/Modal/ClientSelfLookup/Form.tsx","components/Modal/ClientSelfLookup/index.tsx","components/Modal/CompositionLookup/FragmentsTableRow.tsx","components/Modal/CompositionLookup/FragmentsTable.tsx","components/Modal/CompositionLookup/index.tsx","shared/locale.ts","components/Modal/CompositionPriceLookup/index.tsx","components/Modal/GPTModel/index.tsx","components/Modal/Import/index.tsx","components/Modal/Import/Composition/Fields.tsx","components/Modal/Import/StatusBadge.tsx","components/Modal/Import/Composition/ElementPreviewTableRow.tsx","components/Modal/Import/Composition/ElementPreviewTable.tsx","components/Modal/Import/Composition/ImportPreviewTableRow.tsx","components/Modal/Import/Composition/ImportPreviewTable.tsx","components/Modal/Import/Composition/Overview.tsx","components/Modal/Import/Input/Fields.tsx","components/Modal/Import/Input/Overview.tsx","components/Modal/InputPriceLookup/index.tsx","components/Modal/LocaleAndPriceTypeSelect/index.tsx","components/Modal/ManageFlow/index.tsx","components/Modal/ManageParametricFlow/index.tsx","components/Modal/OwnCompositionSelect/SearchFilter.tsx","components/Modal/OwnCompositionSelect/index.tsx","components/Modal/OwnInputSelect/SearchFilter.tsx","components/Modal/OwnInputSelect/index.tsx","components/Modal/ParametricBudgetHistory/StatusBadge.tsx","components/Modal/ParametricBudgetHistory/index.tsx","components/Modal/ParametricBudgetLookup/BuildingDescriptionPopover.tsx","components/Modal/ParametricBudgetLookup/shared.ts","components/Modal/ParametricBudgetLookup/index.tsx","components/Modal/PositionUpdate/index.tsx","components/Modal/StageAdd/index.tsx","components/Modal/SubscriptionHistory/getStatusBadge.tsx","components/Modal/SubscriptionHistory/index.tsx","components/Modal/SubscriptionHistory/getPaymentMethod.ts","components/Modal/Support/index.tsx","components/Modal/Root/modalList.ts","components/Modal/VersionAdd/index.tsx","components/Modal/UserInvite/index.tsx","components/Modal/UserOrganizationLookup/index.tsx","components/Modal/Root/index.tsx","styles/theme/components/Badge.ts","styles/theme/components/Box.ts","styles/theme/components/Button.ts","styles/theme/components/Form.ts","styles/theme/components/IconButton.ts","styles/theme/components/Input.ts","styles/theme/components/Select.ts","styles/theme/components/Table.ts","styles/theme/components/Tooltip.ts","styles/theme/customTheme.ts","styles/theme/colors.ts","App.tsx","index.tsx","shared/date.ts","components/StatusCircle/index.tsx","contexts/TableContext.tsx","components/Table/Table.tsx","components/Table/Tbody.tsx","components/Table/Thead.tsx","components/Table/Td.tsx","components/Table/Tr.tsx","components/Table/Th.tsx","hooks/useModal.ts","components/SummaryContainer/index.tsx"],"names":["api","createApiClient","baseURL","env","MotionBox","motion","Box","SummaryCard","props","idx","isHidden","loading","typeNumber","summaryData","data","rest","padding","bg","borderWidth","borderRadius","position","width","base","lg","initial","opacity","scale","animate","transition","duration","exit","top","direction","alignItems","justifyContent","icon","_before","content","background","colorSchemeType","colorSchemeCard","right","left","bottom","as","height","color","overflow","marginTop","fontSize","fontWeight","textTransform","whiteSpace","formattedNumber","altNumber","marginLeft","complementaryNumber","title","render","toast","createStandaloneToast","defaultOptions","variant","isClosable","useAlert","alert","useContext","AlertContext","Error","roles","name","manager","default","mergeRoles","userData","managed_organization","flat","getUserRoleName","roleArray","i","length","includes","getRoleName","is","role","user","isSuperAdmin","isEcustosAdmin","isSuperOrEcustosAdmin","useDebouncedState","initialValue","delay","useState","debouncedValue","setDebouncedValue","value","setValue","useEffect","handler","setTimeout","clearTimeout","SummaryDataChartCard","hasAnyData","Boolean","chart","series","reduce","acc","curr","gap","options","type","fontFamily","labels","dataLabels","enabled","colors","tooltip","y","formatter","Intl","NumberFormat","style","currency","format","legend","show","responsive","breakpoint","createContext","AlertProvider","children","list","setList","openCustomAlert","key","oldList","Provider","alerts","openAlert","closeAlert","filter","Alert","ModalContext","ModalProvider","modals","openModal","closeModal","modal","FallbackSpinner","src","logoSymbol","marginBottom","SidebarContext","SidebarProvider","open","setOpen","isSticked","setIsSticked","useMediaQuery","isMobile","toggleSidebar","toggleStick","openSidebar","closeSidebar","sidebarWidth","headerHeight","sidebarClosedWidth","sidebarOpenWidth","cssVarPrefix","defaultColorMode","useSystemColorMode","process","variants","rotate","closed","UpCircleIconMotion","Icon","DropdownIndicator","selectProps","components","UpCircleIcon","menuIsOpen","w","h","LoadingIndicator","Loader","OwnSelect","isInvalid","sx","zIndex","paddingX","boxShadow","backgroundColor","borderColor","undefined","_hover","cursor","outline","IndicatorSeparator","classNamePrefix","Container","styled","div","Pagination","forcePage","lastPage","onPaginate","useAlternativeColors","my","boxSizing","listStyle","display","userSelect","margin","textDecoration","marginRight","previousLabel","AngleLeftIcon","nextLabel","AngleRightIcon","breakLabel","breakClassName","pageCount","marginPagesDisplayed","pageRangeDisplayed","onPageChange","selected","containerClassName","activeClassName","useThrottledState","thottledValue","setThrottledValue","throttled","useRef","throttle","newValue","current","createColumns","cols","col","condition","AppTable","mapping","noDataMessage","initialSort","onUpdateSort","sort","setSort","rows","setRows","mappingObject","map","d","isReactNode","useCallback","field","isActionsColumn","getColumnIcon","column","allFields","split","fieldExists","some","f","find","index","findIndex","startsWith","isNumeric","SortNumericDescendingIcon","SortAlphabeticalDescendingIcon","mx","SortNumericAscendingIcon","SortAlphabeticalAscendingIcon","handleSortChange","event","row","existsField","newSortArray","indexOf","splice","newSort","join","shiftKey","concat","replace","handleOnClick","sortable","description","getClassNames","classNames","clickable","shouldCenter","isCentered","inHeader","onClick","className","textAlign","Date","rowKeys","Object","keys","id","active","deleted","mapTd","columnKey","highlighted","colSpan","memo","axios","create","headers","Accept","isAxiosError","e","getErrors","useCookie","cookieName","Cookies","get","set","remove","cookieOptions","path","domain","expires","useAuth","history","useHistory","setLoading","authenticated","setAuthenticated","cookieTokenKey","cookieJwtKey","useCookies","token","setToken","removeToken","jwtManagement","setJwt","removeJwt","userOrganizations","setUserOrganizations","validating","setValidating","setUser","shouldRedirectToAnotherFrontend","organization","url","currentFrontend","window","location","href","targetFrontend","currentUrl","URL","targetUrl","hostname","getAuth","a","userInfo","userOrganization","defaults","Authorization","common","status","getUserOrganizationDefault","organizationId","userId","params","organization_id","user_id","response","message","handleSelectOrganization","organizationJwt","getUserOrganizations","page","per_page","userOrganizationsLoaded","jwt_management","push","handleLogout","force","delete","handleLogin","email","password","post","encodeURIComponent","handleTwoFactorAuth","code","authUser","accessToken","then","wehelpCustomerInfo","debug","survey_token","message_open","language","company_unit","experience_id","person","internal_code","custom_fields","loadWeHelpWidgetScreen","AuthContext","AuthProvider","auth","loadFragmentsFn","AuthRoutes","lazy","AppRoutes","withRouter","useLocation","scrollTo","document","body","scrollTop","documentElement","pathname","fallback","genericAlert","descr","buttons","onConfirm","handleClose","restProps","cancelRef","React","useMemo","WarningIcon","InfoCircleIcon","colorScheme","isOpen","motionPreset","leastDestructiveRef","onClose","ref","ml","dangerDeleteAlert","inputValue","setInputValue","confirmText","isConfirmTextValid","localeCompare","sensitivity","size","mt","onChange","target","isDisabled","AlertRoot","Component","alertList","closeOnOverlayClick","ModalABCValues","valueA","setValueA","valueB","setValueB","valueC","setValueC","handleSubmitValues","scrollBehavior","flexDirection","marginY","templateColumns","columnGap","rowGap","customInput","Input","displayType","placeholder","fixedDecimalScale","thousandSeparator","decimalSeparator","suffix","decimalScale","onValueChange","v","floatValue","ModalBaseAdd","mode","setDescription","modelType","descriptionRef","use_social_law","useSocialLaw","setUseSocialLaw","isAllStates","setIsAllStates","stateSelected","setStateSelected","localeList","setLocaleList","stateList","setStateList","selectedPriceType","setSelectedPriceType","isFindingStates","setIsFindingStates","isFindingLocales","setIsFindingLocales","setIsFindingPriceTypes","errors","setErrors","focus","statesToSelect","state","label","getStates","responseStates","states","getLocales","base_id","responseLocales","locales","getPriceTypes","responsePriceTypes","localesIds","locale","abbreviation","getStatesNameById","stateId","handleConfirm","formErrors","assign","model_type","price_types","newBase","newBaseId","put","columns","md","spacing","onKeyPress","toLocaleUpperCase","isReadOnly","mr","isChecked","checked","isMulti","s","isLoading","isClearable","Number","_disabled","border","hasArrow","InfoCircleFillIcon","ModalBaseSelect","bases","setBases","selectedBase","setSelectedBase","getBases","basesLoaded","basesToSelect","String","item","ModalBudgetCompositionObservation","budgetId","component","observation","setObservation","handleSubmitComponents","quantity","composition_price_id","composition_price","mb","composition","resize","FragmentTableRow","visibleColumns","renderRowSubComponent","getType","tableRow","original","fragment_type","getRowProps","getToggleRowExpandedProps","isExpanded","cells","cell","getCellProps","stopPropagation","toggleRowExpanded","getCustomCellProps","borderBottomColor","py","borderBottom","paddingY","isComposition","nextComponentId","fragment","nextComponentPriceTypeKey","price_type","FragmentsTable","isSubRow","parentFragments","registerLoadFragments","budget_id","budget_bases","component_id","locale_id","locale_key","price_type_id","price_type_key","getSummary","reloadTable","useModal","fragments","setFragments","isEditingFragment","setIsEditingFragment","qttySummary","setQttySummary","getData","fragmentsLoaded","newQttySummary","total_compositions","summary","total","total_inputs","newQuantity","coefficient","newUnitPrice","unit_price","isInput","getIcon","InfoIcon","GroupIcon","getInputIcon","classification","BricksIcon","TrafficConeIcon","ShovelIcon","CardAccountDetails","getInputIconType","handleRemoveFragment","resource","oldFragments","newFragments","handleUpdateQuantity","handleUpdateUnitPrice","price_id","Header","Cell","DownArrowIcon","RightArrowIcon","accessor","version","maxWidth","unit_measure","values","allowNegative","oldData","newData","borderTopRightRadius","borderBottomRightRadius","px","aria-label","SaveIcon","borderTopLeftRadius","borderBottomLeftRadius","CloseIcon","coefficient_was_changed","textDecor","maximumFractionDigits","coefficient_original","price","prefix","unit_price_was_changed","unit_price_original","IconButton","CogIcon","compositionId","getRowId","useTable","autoResetExpanded","useExpanded","getTableProps","getTableBodyProps","headerGroups","prepareRow","parent","fontStyle","headerGroup","getHeaderGroupProps","getHeaderProps","modalMargin","ModalCompositionEdit","setSummary","summaryLoaded","material","material_percent","equipment","equipment_percent","labor","labor_percent","third_party","third_party_percent","other","other_percent","fn","closeOnEsc","maxHeight","SummaryContainer","DollarSignIcon","number","leftIcon","PlusIcon","RefreshIcon","SearchFilter","budgetBases","onSubmit","useForm","handleSubmit","register","control","formState","selectedBaseVersion","setSelectedBaseVersion","selectedBaseLocale","setSelectedBaseLocale","selectedBasePriceType","setSelectedBasePriceType","classifications","setClassifications","selectedClassification","setSelectedClassification","isLoadingClassifications","setIsLoadingClassifications","classificationTypes","setClassificationTypes","selectedClassificationType","setSelectedClassificationType","isLoadingTypes","setIsLoadingTypes","unitMeasures","setUnitMeasures","selectedUnitMeasure","setSelectedUnitMeasure","isLoadingUnitMeasures","setIsLoadingUnitMeasures","prepareSubmit","getClassifications","baseId","classificationsLoaded","classificationsToSelect","getClassificationTypes","classificationId","classificationTypesLoaded","classificationTypesToSelect","getUnitMeasures","unitMeasuresLoaded","unitMeasuresToSelect","unitMeasure","handleBaseChange","baseSelected","handleClassificationChange","versionDescription","localeDescription","priceTypeDescription","rules","required","version_id","_readOnly","type_id","maxMenuHeight","FilterIcon","ModalBudgetCompositionFragmentSelect","activeTab","setActiveTab","compositions","setCompositions","pagination","setPagination","searchFilter","setSearchFilter","hasRequiredFilters","last_page","servicePagination","setServicePagination","selectedCompositions","setSelectedCompositions","processFilters","validFilter","classification_id","classification_type_id","unit_measure_id","getPrice","getStatePrice","isDefaultPrice","taxed","untaxed","processSort","sortString","isDesc","slice","compositionsData","newPagination","meta","handleDeleteComposition","c","_id","_source","prices","Array","from","prepareComponents","composition_id","oldPagination","rightIcon","ArrowRightIcon","CheckIcon","_selected","marginX","p","pt","defaultValue","actions","prepared","handleSelectComposition","disabled","selectedPage","Table","tabIndex","TrashAltIcon","ModalBudgetCompositionLookup","ModalBudgetCompositionSelect","subStageId","saving","setSaving","fakeProgress","setFakeProgress","parent_stage_id","budget_base_id","b","interval","setInterval","oldProgress","clearInterval","Math","min","hasStripe","isAnimated","initialData","isSaving","isLoadingFilters","setIsLoadingFilters","defaultValues","clearErrors","setError","setQuantity","setLabor","setMaterial","setEquipment","setThirdPartyServices","setOther","unitPrice","setUnitPrice","total_value","totalValue","setTotalValue","unitPriceTotal","templateAreas","gridTemplateColumns","readOnly","ModalBudgetCustomCompositionAdd","getCustomComposition","budget_composition_price","social_law_price","third_party_services","immobilized","prepareCustomComponent","refund","handleSubmitComponent","Form","ModalBudgetGlobalPriceChange","client","budget","setMode","change","setChange","changeLabel","changeInputsProps","changeIcon","paddingBottom","isAllowedToChangeValue","approximateValue","n","decreased","difference","total_bdi","gross_total","payloadChangeType","payloadCalculationType","onConfirmSubmit","change_type","calculation_type","identification","type_person","fantasy_name","corporate_name","bdi_percent","prev","FlowStatusBadge","StatusCircle","ModalManageFlow","budgetData","setData","getUserName","document_type","borderTop","noOfLines","textOverflow","flow_status","formatDate","created_at","total_separate_percent","responsible","ModalBudgetInputFragmentSelect","inputs","setInputs","selectedInputs","setSelectedInputs","input","inputsData","handleDeleteInput","input_id","handleSelectInput","ChakraInput","ModalBudgetInputSelect","CompositionRow","selectedComponents","handleSelectComponent","handleDeleteComponent","flexDir","MdiGroupIcon","outdated_price","InputRow","input_price","OutdatedComponentsBody","getRow","OutdatedComponentsTable","toggleSelectAllComponents","OutdatedComponentsTableBody","ModalBudgetOutdatedComponentSelect","setComponents","setSelectedComponents","componentsData","budget_components","ModalClientLookup","clientList","setClientList","keyword","setKeyword","getClientList","clients","flexWrap","gridGap","phone","cell_phone","contact","FormClientLookup","htmlFor","cep","state_name","city_name","address","complement","district","setClient","getClient","client_id","clientLoaded","zip_code","city_id","prepareClient","ModalCompositionLookup","JSON","parse","price_","stateDescriptionByKey","AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO","sortLocales","ModalCompositionPricesLookup","mappedPrices","entries","taxed_total","untaxed_total","composition_description","ModalGPTModel","model","setModel","prompt","setPrompt","baseStyle","flex","borderStyle","focusedStyle","selectedStyle","acceptStyle","rejectStyle","ModalImport","isLoadingBases","setIsLoadingBases","baseVersions","setBaseVersions","isLoadingBaseVersions","setIsLoadingBaseVersions","progress","setProgress","file","setFile","headerLine","setHeaderLine","getBaseVersions","baseVersionsLoaded","baseVersion","baseVersionsToSelect","onDrop","acceptedFiles","accept","useDropzone","getRootProps","getInputProps","isDragActive","isFocused","isDragAccept","isDragReject","header","formData","FormData","append","onUploadProgress","progressEvent","uploadPercentage","round","loaded","importId","mappedHeaders","mapped_header","headerRow","header_row","importedFile","baseName","versionName","fileName","newErrors","extensions","dropMessage","AnimatePresence","setHeaders","actualHeaders","isUpdatingHeader","setIsUpdatingHeader","newHeaderLine","setNewHeaderLine","type_","composition_code","composition_type","class","untaxed_price","taxed_price","fields","setFields","mappedColumns","handleUpdateHeader","mapped_columns","ImportStatusBadge","getBadgeColor","getBadgeDescription","hasCircle","ElementPreviewTableRow","_index","compositionCode","raw_data","ElementPreviewTable","importPreview","setImportPreview","setStatus","getImportPreview","responseData","shouldShowInputIcon","getInputTitle","nextCompositionCode","ImportPreviewTableRow","ImportPreviewTable","refetchInterval","setRefetchInterval","scrollingBody","targetElement","success","error","getImport","queryImport","useQuery","refetchOnWindowFocus","onSuccess","isImporting","isStoring","offsetTop","behavior","GlobeIcon","progress_bar","elapsed_for_humans","start_time_iso","progress_percent","remaining_for_humans","estimated_for_humans","line","ModalInputPricesLookup","inputs_description","ModalLocaleAndPriceTypeSelect","baseLocales","setBaseLocales","isLoadingBaseLocales","setIsLoadingBaseLocales","basePriceTypes","setBasePriceTypes","isLoadingPriceTypes","setIsLoadingPriceTypes","getBaseLocales","baseLocalesLoaded","baseLocale","prevErrors","baseLocalesToSelect","getBasePriceTypes","basePriceTypesLoaded","basePriceType","basePriceTypesToSelect","l","priceType","t","spin","keyframes","formatOptionLabel","spinAnimation","flexShrink","animation","selectedAction","setSelectedAction","actionList","actionsToSelect","getClientName","object_type","object_id","flow_key","ModalManageParametricFlow","build_description","selectedBaseObj","preparedComponents","ModalOwnInputSelect","ModalParametricBudgetHistory","BuildingDetailsPopover","placement","substr","minWidth","maxW","overflowY","dangerouslySetInnerHTML","__html","typeMap","single_family_residence","affordable_housing_pp","multi_family_residence_r8","multi_family_residence_r16","social_interest_project","affordable_housing_rp1q","commercial_open_floors","commercial_offices_and_stores_csl8","commercial_offices_and_stores_csl16","industrial_warehouse","patternMap","ModalParametricBudgetLookup","parametricBudgets","getPatternDescription","buildType","pattern","BuildingDescriptionPopover","build_type","build_pattern","total_cost","parametricBudget","ModalPositionUpdate","setPosition","positionRef","item_id","ModalStageAdd","initialLoad","setInitialLoad","setTitle","titleRef","stage_id","input_price_id","valueAsNumber","getStatusBadge","ModalSubscriptionHistory","histories","reversedHistories","reverse","transaction_id","payment_method","paymentMethod","ModalSupport","WhatsAppIcon","boxSize","rel","MailIcon","baseAdd","baseSelect","versionAdd","reference","referenceMonth","year","month","yearNum","monthNum","clientLookup","clientSelfLookup","ModalClientSelfLookup","compositionLookup","budgetCompositionLookup","compositionPriceLookup","inputPriceLookup","userInvite","emailValidator","yup","group_id","setEmail","setRole","isValid","Button","bgColor","_active","roleDescriptionByKey","budgetCompositionSelect","budgetCompositionFragmentSelect","budgetComponentObservation","ModalBudgetComponentObservation","budgetInputSelect","budgetInputFragmentSelect","stageAdd","positionUpdate","ownCompositionSelect","ModalOwnCompositionSelect","ownInputSelect","import","inputImportFields","ModalImportInputFields","compositionImportFields","ModalImportCompositionFields","importInputOverview","ModalImportInputOverview","importCompositionOverview","ModalImportCompositionOverview","budgetCompositionEdit","ModalBudgetCompositionEdit","subscriptionHistory","userOrganizationLookup","getOrganizationName","u","canCloseModal","email_verified_at","abcValues","support","flowChange","budgetHistory","ModalBudgetHistory","parametricFlowChange","parametricBudgetHistory","gptModel","parametricBudgetLookup","budgetCustomCompositionAdd","budgetOutdatedComponentSelect","localeAndPriceTypeSelect","budgetGlobalPriceChange","ModalRoot","modalList","Badge","defaultProps","FormLabel","_invalid","FormError","text","isRound","ecustos","errorBorderColor","transitionDuration","_focus","_placeholder","Select","pointerEvents","touchAction","ariaDisabled","Td","Tooltip","customTheme","extendTheme","config","brand","50","100","200","300","400","500","600","700","800","900","go","purple","pink","yellow","green","lime","blue","oceanBlue","gray","indigo","styles","global","fonts","heading","mono","transitionTimingFunction","queryClient","QueryClient","App","theme","DndProvider","backend","HTML5Backend","ReactDOM","StrictMode","getElementById","date","toFilterFormat","utcToZonedTime","centered","weight","TableContext","classes","Tbody","Thead","isValidElement","cloneElement","TdInner","narrowHeaders","noData","innerOnClick","data-testid","Consumer","TrInner","Children","child","childProps","Tr","Th"],"mappings":"2HAAA,uDAIaA,EAAMC,YAAgB,CACjCC,QAASC,YAAI,wB,iHCaTC,EAAYC,YAAOC,KAqNVC,IAzKK,SAACC,GAAiD,IAGlEC,EAMED,EANFC,IACAC,EAKEF,EALFE,SACAC,EAIEH,EAJFG,QALiE,EAS/DH,EAHFI,kBANiE,MAMpD,WANoD,EAO3DC,EAEJL,EAFFM,KACGC,EAR8D,YAS/DP,EAT+D,kDAWnE,OACE,cAAC,IAAD,WACIE,GACA,cAACN,EAAD,2BACMW,GADN,IAEEC,QAAQ,IACRC,GAAG,QACHC,YAAa,EACbC,aAAa,MACbC,SAAS,WACTC,MAAO,CAAEC,KAAM,OAAQC,GAAI,SAC3BC,QAAS,CACPC,QAAS,EACTC,MAAO,IAETC,QAAS,CACPF,QAAS,EACTC,MAAO,EACPE,WAAY,CACVC,SAAU,KAAQpB,GAAO,GAAK,KAGlCqB,KAAM,CACJL,QAAS,EACTM,KAAM,IAERH,WAAW,iBAvBb,SA+BE,eAAC,IAAD,CACEI,UAAU,SACVC,WAAW,SACXC,eAAe,gBACflB,QAAS,EAJX,UAMGH,EAAYsB,MACX,cAAC,IAAD,CACEf,SAAS,WACTJ,QAAS,EACToB,QAAS,CACPC,QAAS,KACTC,WACkC,WAAhCzB,EAAY0B,gBACR1B,EAAY2B,gBADhB,UAEO3B,EAAY2B,gBAFnB,QAGF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EAA+B3H,EAA/B2H,SAAUxH,EAAqBH,EAArBG,QAAYI,EAD+C,YACtCP,EADsC,wBAG7E,OACE,cAAC,IAAD,yBACEa,MAAM,OACNmI,aAAa,IACb4D,QAAQ,OACRlL,eAAe,SACfD,WAAW,SACXkb,cAAe,CAAE7b,KAAM,SAAUC,GAAI,OACrCsF,IAAI,KACA9F,GARN,aAUGoH,GACC4S,IAAM27B,SAAS9mC,IAAIzH,GAAU,SAACwuC,EAAOl2C,GACnC,OACEsa,IAAMk7B,eAAeU,IACrB57B,IAAMm7B,aAAaS,EAAO,CAAEl2C,MAAKE,qB","file":"static/js/main.9648c001.chunk.js","sourcesContent":["import { env } from 'shared/env';\n\nimport { createApiClient } from './axios';\n\nexport const api = createApiClient({\n baseURL: env('REACT_APP_API_URL'),\n});\n","import React from 'react';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { MdiReactIconComponentType } from 'mdi-react';\n\nimport {\n Box,\n BoxProps,\n Icon,\n IconProps,\n Heading,\n Text,\n Skeleton,\n Flex,\n} from '@chakra-ui/react';\n\nconst MotionBox = motion(Box);\n\ntype SummaryData = {\n // tooltipLabel: string;\n number: number | React.Component;\n formattedNumber: number | string;\n altNumber?: number | string | React.Component;\n formattedAltNumber?: number | string;\n complementaryNumber?: number | string;\n title: string | JSX.Element;\n render?: () => JSX.Element | null;\n icon?: StyledIcon | MdiReactIconComponentType | typeof Icon;\n colorSchemeType?: 'chakra' | 'manual';\n colorSchemeCard: string;\n};\ninterface SummaryCardProps extends BoxProps {\n isHidden: boolean;\n idx: number;\n data: SummaryData;\n typeNumber: 'currency' | 'number';\n loading?: boolean;\n}\n\nexport const SummaryHelper: React.FC = ({ children }) => {\n return (\n \n {children}\n \n );\n};\n\nexport const SummaryHelperIcon: React.FC = ({ ...props }) => {\n return (\n \n );\n};\n\nconst SummaryCard = (props: SummaryCardProps): React.ReactElement => {\n const {\n // children,\n idx,\n isHidden,\n loading,\n typeNumber = 'currency',\n data: summaryData,\n ...rest\n } = props;\n\n return (\n \n {!isHidden && (\n \n {/* \n \n \n \n */}\n\n \n {summaryData.icon && (\n \n \n \n )}\n\n \n {/* \n \n {summaryData.title}{' '}\n {summaryData.formattedAltNumber && (\n <>({summaryData.formattedAltNumber})\n )}\n \n\n \n {summaryData.formattedNumber}\n \n\n \n {summaryData.tooltipLabel}\n \n \n }\n > */}\n \n {loading ? (\n \n ) : (\n <>\n {typeNumber === 'currency' ? 'R$ ' : ''}\n {summaryData.formattedNumber}\n {summaryData.altNumber && (\n \n ({summaryData.altNumber})\n \n )}\n \n )}\n \n {/* */}\n\n {summaryData.complementaryNumber && (\n \n {summaryData.complementaryNumber}\n \n )}\n\n \n {summaryData.title}\n \n\n {summaryData.render && (\n {summaryData.render()}\n )}\n \n \n \n )}\n \n );\n};\n\nexport default SummaryCard;\n","import { createStandaloneToast } from '@chakra-ui/react';\n\nexport const toast = createStandaloneToast({\n defaultOptions: {\n position: 'top-right',\n variant: 'solid',\n isClosable: true,\n duration: 5000,\n },\n});\n","import { useContext } from 'react';\n\nimport AlertContext, { IAlertContext } from 'contexts/AlertContext';\n\nfunction useAlert(): IAlertContext {\n const alert = useContext(AlertContext);\n\n if (!alert) {\n throw new Error('You have to use \"useAlert()\" inside AlertProvider');\n }\n\n return alert;\n}\n\nexport type { AlertProps, IAlertContext } from 'contexts/AlertContext';\n\nexport default useAlert;\n","import { UserOrganization } from 'types/access-control';\n\nconst roles = {\n 'super-admin': {\n name: 'Super Admin',\n color: 'orange',\n },\n 'ecustos-admin': {\n name: 'Suporte',\n color: 'orange',\n },\n 'organization-admin': {\n name: 'Administrador',\n color: 'brand',\n },\n 'organization-user': {\n name: 'Gestor',\n color: 'blue',\n },\n 'group-admin': {\n name: 'Construtora',\n color: 'green',\n },\n manager: {\n name: 'Gerenciadora',\n color: 'purple',\n },\n default: {\n name: 'Usuário',\n color: 'gray',\n },\n};\n\ntype Key = keyof typeof roles;\n\nexport const getColorByRole = (roleArray: string[]): string => {\n for (let i = 0; i < roleArray.length; i += 1) {\n if (roleArray.includes(roleArray[i])) {\n return roles[roleArray[i] as Key].color;\n }\n }\n\n return roles.default.color;\n};\n\nexport const getRoleName = (roleArray: string[]): string => {\n for (let i = 0; i < roleArray.length; i += 1) {\n if (roleArray.includes(roleArray[i])) {\n return roles[roleArray[i] as Key].name;\n }\n }\n\n return roles.default.name;\n};\n\nexport const mergeRoles = (userData: UserOrganization): string[] => {\n return [\n userData.roles ? [...userData.roles] : [],\n userData.managed_organization?.roles\n ? [...userData.managed_organization.roles]\n : [],\n ].flat();\n};\n\nexport const getUserRoleName = (userData: UserOrganization): string => {\n const userRoles = mergeRoles(userData);\n return getRoleName(userRoles);\n};\n\nexport const SUPER_ADMIN = 'super-admin';\nexport const ECUSTOS_ADMIN = 'ecustos-admin';\nexport const ORGANIZATION_ADMIN = 'organization-admin';\nexport const ORGANIZATION_USER = 'organization-user';\nexport const GROUP_ADMIN = 'group-admin';\nexport const MANAGER = 'manager';\nexport const DEFAULT = 'default';\n\nconst is =\n (role: string) =>\n (user: UserOrganization): boolean => {\n const userRoles = mergeRoles(user);\n return userRoles.includes(role);\n };\n\nexport const isSuperAdmin = is(SUPER_ADMIN);\nexport const isEcustosAdmin = is(ECUSTOS_ADMIN);\nexport const isOrganizationAdmin = is(ORGANIZATION_ADMIN);\nexport const isOrganizationUser = is(ORGANIZATION_USER);\nexport const isGroupAdmin = is(GROUP_ADMIN);\nexport const isManager = is(MANAGER);\nexport const isDefault = is(DEFAULT);\n\nexport const isBankAccount = (user: UserOrganization): boolean => {\n return isOrganizationAdmin(user) || isOrganizationUser(user);\n};\n\nexport const isSuperOrEcustosAdmin = (user: UserOrganization): boolean => {\n return isSuperAdmin(user) || isEcustosAdmin(user);\n};\n\nexport const createCanFunction =\n (user: UserOrganization) =>\n (guard: (user: UserOrganization) => boolean): boolean => {\n if (isSuperOrEcustosAdmin(user)) {\n return true;\n }\n\n return guard(user);\n };\n","import { useState, useEffect, Dispatch, SetStateAction } from 'react';\n\ntype Response = [T, Dispatch>];\n\nfunction useDebouncedState(initialValue: T, delay = 300): Response {\n const [debouncedValue, setDebouncedValue] = useState(initialValue);\n const [value, setValue] = useState(initialValue);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return [debouncedValue, setValue];\n}\n\nexport default useDebouncedState;\n","import React from 'react';\nimport ReactApexCharts from 'react-apexcharts';\n\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { MdiReactIconComponentType } from 'mdi-react';\n\nimport {\n Box,\n BoxProps,\n Icon,\n Heading,\n Text,\n Skeleton,\n Flex,\n} from '@chakra-ui/react';\n\nconst MotionBox = motion(Box);\n\ntype SummaryData = {\n // tooltipLabel: string;\n number: number | React.Component;\n formattedNumber: number | string;\n altNumber?: number | string | React.Component;\n formattedAltNumber?: number | string;\n title: string | JSX.Element;\n icon?: StyledIcon | MdiReactIconComponentType | typeof Icon;\n colorSchemeType?: 'chakra' | 'manual';\n colorSchemeCard: string;\n\n chart: {\n colors: string[];\n labels: string[];\n series: number[];\n };\n};\ninterface SummaryDataChartCardProps extends BoxProps {\n isHidden: boolean;\n idx: number;\n data: SummaryData;\n typeNumber: 'currency' | 'number';\n loading?: boolean;\n}\n\nconst SummaryDataChartCard = (\n props: SummaryDataChartCardProps,\n): React.ReactElement => {\n const {\n idx,\n isHidden,\n loading,\n typeNumber = 'currency',\n data: summaryData,\n ...rest\n } = props;\n\n const hasAnyData = Boolean(\n summaryData.chart.series.reduce((acc, curr) => acc + curr, 0),\n );\n\n return (\n \n {!isHidden && (\n \n \n \n {summaryData.icon && (\n \n \n \n )}\n\n \n \n {loading ? (\n \n ) : (\n <>\n {typeNumber === 'currency' ? 'R$ ' : ''}\n {summaryData.formattedNumber}\n {summaryData.altNumber && (\n \n ({summaryData.altNumber})\n \n )}\n \n )}\n \n\n \n {summaryData.title}\n \n \n \n\n {hasAnyData && (\n \n )}\n \n \n )}\n \n );\n};\n\nexport default SummaryDataChartCard;\n","import React, { useState, createContext } from 'react';\n\nimport { AlertKey } from 'components/Alert/Root';\n\nexport interface AlertProps {\n type: 'info' | 'warning' | 'danger';\n title?: string;\n description?: string | (() => JSX.Element);\n buttons?: [string, string];\n /* eslint-disable-next-line */\n data?: Record;\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';\n /* eslint-disable-next-line */\n onConfirm?: (...args: any[]) => void;\n}\n\nexport interface Alert {\n key: AlertKey;\n props?: AlertProps;\n}\n\nexport interface IAlertContext {\n alerts: Alert[];\n openCustomAlert: (key: AlertKey, data?: AlertProps) => void;\n openAlert: (data: AlertProps) => void;\n closeAlert: (key: AlertKey) => void;\n}\n\nconst AlertContext = createContext({} as IAlertContext);\n\nexport const AlertProvider: React.FC = ({ children }) => {\n const [list, setList] = useState([]);\n\n const openCustomAlert = (key: AlertKey, props?: AlertProps): void => {\n setList((oldList) => [...oldList, { key, props }]);\n };\n\n const openAlert = (props: AlertProps): void => {\n openCustomAlert('genericAlert', props);\n };\n\n const closeAlert = (key: string): void => {\n setList((oldList) => oldList.filter((Alert) => Alert.key !== key));\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport type { AlertKey } from 'components/Alert/Root';\nexport default AlertContext;\n","import React, { useState, createContext } from 'react';\n\nimport { ModalKey } from 'components/Modal/Root';\n\nexport interface ModalProps {\n mode: 'edit' | 'add' | 'lookup' | 'select';\n /* eslint-disable-next-line */\n data?: Record;\n /* eslint-disable-next-line */\n onConfirm?: (...args: any[]) => void;\n}\n\nexport interface Modal {\n key: ModalKey;\n props?: ModalProps;\n}\n\nexport interface IModalContext {\n modals: Modal[];\n openModal: (key: ModalKey, data?: ModalProps) => void;\n closeModal: (key: ModalKey) => void;\n}\n\nconst ModalContext = createContext({} as IModalContext);\n\nexport const ModalProvider: React.FC = ({ children }) => {\n const [list, setList] = useState([]);\n\n const openModal = (key: ModalKey, props?: ModalProps): void => {\n setList((oldList) => [...oldList, { key, props }]);\n };\n\n const closeModal = (key: string): void => {\n setList((oldList) => oldList.filter((modal) => modal.key !== key));\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport type { ModalKey } from 'components/Modal/Root';\nexport default ModalContext;\n","import React from 'react';\n\nimport { Spinner, Image, Flex } from '@chakra-ui/react';\n\nimport logoSymbol from 'assets/img/symbol.png';\n\nconst FallbackSpinner: React.FC = () => {\n return (\n \n \n \n \n );\n};\n\nexport default FallbackSpinner;\n","import React, { createContext, useState } from 'react';\n\nimport { useMediaQuery } from '@chakra-ui/react';\n\ninterface ISidebar {\n open: boolean;\n variant: 'sidebar';\n isMobile: boolean;\n isSticked: boolean;\n toggleSidebar(): void;\n toggleStick(): void;\n openSidebar(): void;\n closeSidebar(): void;\n}\n\nconst SidebarContext = createContext({} as ISidebar);\n\nexport const SidebarProvider: React.FC = ({ children }) => {\n const [open, setOpen] = useState(false);\n const [isSticked, setIsSticked] = useState(false);\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const toggleSidebar = (): void => {\n setOpen(!open);\n };\n\n const toggleStick = (): void => {\n setIsSticked(!isSticked);\n };\n\n const closeSidebar = (): void => setOpen(false);\n const openSidebar = (): void => setOpen(true);\n\n return (\n \n {children}\n \n );\n};\n\nexport default SidebarContext;\n","export const sidebarWidth = 300;\nexport const headerHeight = 80;\n\nexport const sidebarClosedWidth = 0;\nexport const sidebarOpenWidth = 300;\n\nexport default {\n cssVarPrefix: 'ecustos',\n defaultColorMode: 'light',\n useSystemColorMode: false,\n};\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuKEAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3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yCp88lcAGp3MYxirqH8mxHJxkwDZwIXYxdP8+ksyC4HVws5AToPhQ6BNkKnyH4SgelOdNdD+F3Eb83iKdJa1YFC7bUWcQvwh/MIFalBoD2Bc4GPM7u3L4XSGRRnS0nuRcC9iBYqhXOmsDOsmSfy7QmiHoFpP6yg8k1CMaG+43+tw9sP9M+r0t3xa0YqbNGD3Arp6OXYPN3X1Ks57u1nUqINTCqoWYg/1o17xPgE8vVKqcfrCE2/7lP60LNXkkFPgX5yMqPNk0bJnr2KeJRpN3v5Sk/AqC+zKtnTiG9hXuzc7KeHjgLfQzxYHCGfGGCoCd29fxL8NeBLwNPFzWbsw2r8nyKkl4F/wf4y7z3ncU7r6+n5qt5+WOcLYzDZkrbste8YOR1zA+bdRDYQXe0EaKtFixIoOUEHCTwE/rrumXhkISJ6/ymm+9ajLXvxHSMikpGpSlVrCOonFL8UslrImOjDTHuSlptk5PRXrTv29mzS/w/xhGhmFiKEQAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wNi0yMVQwNzo1MTozMi0wNDowMF/xq9MAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDYtMjFUMDc6NTE6MzEtMDQ6MDAfRAnyAAAAAElFTkSuQmCC\"","type Env =\n | 'REACT_APP_API_URL'\n | 'REACT_APP_REVERB_APP_KEY'\n | 'REACT_APP_REVERB_HOST'\n | 'REACT_APP_REVERB_WSS_PORT'\n | 'REACT_APP_REVERB_PORT'\n | 'REACT_APP_REVERB_SCHEME';\n\nexport const env = (key: Env): string => {\n const value = process.env[key];\n if (!value) throw new Error(`${key} is not set.`);\n return value;\n};\n","import React from 'react';\nimport { components, DropdownIndicatorProps } from 'react-select';\n\nimport { ChevronUp as UpCircleIcon } from '@styled-icons/entypo/ChevronUp';\nimport { motion } from 'framer-motion';\n\nimport { Icon } from '@chakra-ui/react';\n\nconst variants = {\n open: { rotate: 0 },\n closed: { rotate: 180 },\n};\n\nconst UpCircleIconMotion = motion(Icon);\n\nconst DropdownIndicator: React.FC = (props) => {\n const { selectProps } = props;\n\n return (\n components.DropdownIndicator && (\n \n \n \n )\n );\n};\n\nexport default DropdownIndicator;\n","import React from 'react';\nimport { components, LoadingIndicatorProps } from 'react-select';\n\nimport Loader from 'components/Loader';\n\nconst LoadingIndicator: React.FC = (props) => {\n return (\n components.LoadingIndicator && (\n \n \n \n )\n );\n};\n\nexport default LoadingIndicator;\n","import React from 'react';\nimport ReactSelect, { Props as ReactSelectProps } from 'react-select';\n\nimport { Box } from '@chakra-ui/react';\n\nimport DropdownIndicator from './components/DropdownIndicator';\nimport LoadingIndicator from './components/LoadingIndicator';\n\nexport type SelectedValue = {\n value: string;\n label: string;\n};\n\nexport type SelectedValues = SelectedValue[];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype OwnSelectProps = ReactSelectProps & {\n isInvalid?: boolean;\n};\n\nconst OwnSelect: React.FC = (props) => {\n const { isInvalid } = props;\n\n return (\n \n \n \n );\n};\n\nexport default OwnSelect;\n","import styled from 'styled-components';\n\nexport const Container = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n\n overflow: hidden;\n`;\n","import React from 'react';\n\nimport { Spinner, SpinnerProps } from '@chakra-ui/react';\n\nimport { Container } from './styles';\n\nconst Loader: React.FC = (props) => {\n return (\n \n \n \n );\n};\n\nexport default Loader;\n","import React from 'react';\nimport ReactPaginate from 'react-paginate';\n\nimport { AngleLeft as AngleLeftIcon } from '@styled-icons/fa-solid/AngleLeft';\nimport { AngleRight as AngleRightIcon } from '@styled-icons/fa-solid/AngleRight';\n\nimport { Flex, Icon } from '@chakra-ui/react';\n\ntype PaginationProps = {\n lastPage: number;\n forcePage?: number;\n onPaginate(selectedPage: number): void;\n useAlternativeColors?: boolean;\n};\n\nconst Pagination: React.FC = ({\n forcePage,\n lastPage,\n onPaginate,\n useAlternativeColors = false,\n}) => {\n return (\n \n }\n nextLabel={}\n breakLabel=\"...\"\n breakClassName=\"break-me\"\n pageCount={lastPage}\n forcePage={forcePage}\n marginPagesDisplayed={2}\n pageRangeDisplayed={3}\n onPageChange={({ selected }) => {\n onPaginate(selected + 1);\n }}\n containerClassName={\n useAlternativeColors ? 'pagination-fragment' : 'pagination'\n }\n activeClassName=\"active\"\n />\n \n );\n};\n\nexport default Pagination;\n","import { useState, useEffect, useRef, Dispatch, SetStateAction } from 'react';\n\nimport throttle from 'lodash/throttle';\n\ntype Response = [T, Dispatch>];\n\nfunction useThrottledState(initialValue: T, delay = 300): Response {\n const [thottledValue, setThrottledValue] = useState(initialValue);\n const [value, setValue] = useState(initialValue);\n\n const throttled = useRef(\n throttle((newValue: T) => setThrottledValue(newValue), delay),\n );\n\n useEffect(() => {\n if (throttled.current) {\n throttled.current(value);\n }\n }, [throttled, value]);\n\n return [thottledValue, setValue];\n}\n\nexport default useThrottledState;\n","import React, { memo, useState, useEffect, useCallback } from 'react';\n\nimport classNames from 'classnames';\nimport SortAlphabeticalAscendingIcon from 'mdi-react/SortAlphabeticalAscendingIcon';\nimport SortAlphabeticalDescendingIcon from 'mdi-react/SortAlphabeticalDescendingIcon';\nimport SortNumericAscendingIcon from 'mdi-react/SortNumericAscendingIcon';\nimport SortNumericDescendingIcon from 'mdi-react/SortNumericDescendingIcon';\n\nimport { TableContainer, Icon } from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport { Table, Thead, Tbody, Tr, Th, Td } from 'components/Table';\n\ntype OnClick = React.MouseEvent;\n\ntype Row = {\n field: string;\n description: Data;\n sortable?: boolean;\n condition?: boolean;\n isNumeric?: boolean;\n isCentered?: boolean;\n};\n\ntype KeyExtractor = { id: string | number };\ntype ActionColumn = { actions: JSX.Element | null };\ntype TableRows = Array;\n\ntype Data =\n | string\n | number\n | boolean\n | Date\n | typeof Function\n | JSX.Element\n | null;\ntype TableData = { [key: string]: Data };\n\ntype MappingFunction = (item: T) => TableData & KeyExtractor & ActionColumn;\n\ninterface TableProps {\n cols: TableRows;\n mapping: MappingFunction;\n data: Array;\n noDataMessage?: string;\n initialSort?: string;\n onUpdateSort?: (sort: string) => void;\n loading?: boolean;\n}\n\nexport function createColumns(cols: Array): Array {\n return cols.filter((col) => {\n if ('condition' in col) {\n return col.condition;\n }\n\n return true;\n });\n}\n\nconst AppTable = ({\n cols,\n mapping,\n data = [],\n noDataMessage = 'Nenhum resultado encontrado. Atualize os filtros e pequise novamente',\n initialSort = '',\n onUpdateSort,\n loading = false,\n}: TableProps): React.ReactElement => {\n const [sort, setSort] = useState(initialSort);\n const [rows, setRows] = useState([]);\n\n useEffect(() => {\n const mappingObject = data.map((d) => mapping(d));\n\n setRows(mappingObject);\n }, [data, mapping]);\n\n const isReactNode = useCallback(\n ({ field }: Row) => typeof field === 'function',\n [],\n );\n\n const isActionsColumn = useCallback(\n ({ field }: Row) => typeof field === 'string' && field === 'actions',\n [],\n );\n\n const getColumnIcon = useCallback(\n (column: Row): React.ReactNode => {\n const allFields = sort.split(',');\n\n const fieldExists = allFields.some(\n (f) => f === column.field || f === `-${column.field}`,\n );\n const field = allFields.find((f) => f.includes(column.field));\n const index = allFields.findIndex((f) => f.includes(column.field));\n\n if (fieldExists && index >= 0) {\n if (!isActionsColumn(column)) {\n return field?.startsWith('-') ? (\n \n ) : (\n \n );\n }\n }\n\n return null;\n },\n [sort, isActionsColumn],\n );\n\n const handleSortChange = useCallback(\n (event: OnClick, row: Row) => {\n const allFields = sort.split(',');\n const existsField = allFields.findIndex((f) => f.includes(row.field));\n\n if (existsField === -1) {\n if (event.shiftKey) {\n const newSort = sort\n .concat(`,${row.field}`)\n .replace(/^,/, '')\n .replace(/^-/, '');\n\n setSort(newSort);\n onUpdateSort?.(newSort);\n } else {\n setSort(row.field);\n onUpdateSort?.(row.field);\n }\n\n return;\n }\n\n const field = allFields.find((f) => f.includes(row.field));\n\n const newSortArray = allFields;\n\n if (existsField >= 0 && field) {\n const index = allFields.indexOf(field);\n newSortArray[index] = `-${field}`;\n }\n\n if (existsField >= 0 && field?.startsWith('-')) {\n const index = allFields.indexOf(field);\n newSortArray.splice(index, 1);\n }\n\n const newSort = newSortArray.join(',');\n setSort(newSort);\n onUpdateSort?.(newSort);\n },\n [sort, onUpdateSort],\n );\n\n const handleOnClick = useCallback(\n (col: Row) => {\n return (event: OnClick) => {\n return (\n !isReactNode(col) &&\n !isActionsColumn(col) &&\n !('sortable' in col && col.sortable === false) &&\n typeof col.description !== 'object' &&\n handleSortChange(event, col)\n );\n };\n },\n [handleSortChange, isActionsColumn, isReactNode],\n );\n\n const getClassNames = useCallback(\n (col) => {\n return classNames({\n clickable:\n !isActionsColumn(col) &&\n !('sortable' in col && col.sortable === false) &&\n typeof col.description !== 'object',\n\n selected:\n !isActionsColumn(col) &&\n sort.split(',').some((f) => f === col.field || f === `-${col.field}`),\n });\n },\n [isActionsColumn, sort],\n );\n\n const shouldCenter = useCallback(\n (col: Row) => {\n if (isActionsColumn(col)) return true;\n return col.isCentered;\n },\n [isActionsColumn],\n );\n\n return (\n \n \n \n \n {cols.map((col) => {\n return (\n \n {typeof col.description !== 'string' &&\n typeof col.description !== 'number' &&\n typeof col.description !== 'boolean' &&\n typeof col.description !== 'object' &&\n !(col.description instanceof Date)\n ? col.description()\n : col.description}\n\n {!isReactNode(col) ? getColumnIcon(col) : null}\n \n );\n })}\n \n \n\n \n {!loading &&\n rows.map((row) => {\n const rowKeys = Object.keys(row);\n const key = row.id;\n\n if (typeof key !== 'number' && typeof key !== 'string') {\n const error = `Invalid row key. You need an alphanumeric id in the mapping object.`;\n throw new Error(error);\n }\n\n const active = rowKeys.includes('active') && row.active === true;\n const deleted =\n rowKeys.includes('deleted') && row.deleted === true;\n\n const mapTd = cols.map((col, index) => {\n const value = row[col.field];\n\n return (\n \n {value || '-'}\n \n );\n });\n\n return (\n \n {mapTd}\n \n );\n })}\n\n {loading && (\n \n \n \n )}\n\n {!loading && data.length === 0 && (\n \n \n \n )}\n \n
\n \n
\n {noDataMessage}\n
\n
\n );\n};\n\nexport default memo(AppTable) as typeof AppTable;\n","import axios, { AxiosError, AxiosInstance } from 'axios';\n\ntype ApiClientOptions = {\n baseURL: string;\n};\n\nexport const createApiClient = (options: ApiClientOptions): AxiosInstance => {\n const client = axios.create({\n baseURL: options.baseURL,\n headers: {\n Accept: 'application/json',\n },\n });\n\n return client;\n};\n\nexport const isAxiosError = (e: unknown): e is AxiosError => {\n if (typeof e !== 'object') return false;\n if (e == null) return false;\n return 'response' in e;\n};\n\nexport const getErrors = (e?: string[]): string => {\n return e ? e.join(', ') : '';\n};\n","import { useCallback, useState } from 'react';\n\nimport Cookies from 'js-cookie';\n\ntype Value = string | null;\ntype UpdateCookie = (\n newValue: string,\n options?: Cookies.CookieAttributes,\n) => void;\ntype DeleteCookie = () => void;\n\nconst useCookie = (cookieName: string): [Value, UpdateCookie, DeleteCookie] => {\n const [value, setValue] = useState(\n () => Cookies.get(cookieName) || null,\n );\n\n const updateCookie = useCallback(\n (newValue: string, options?: Cookies.CookieAttributes) => {\n Cookies.set(cookieName, newValue, options);\n setValue(newValue);\n },\n [cookieName],\n );\n\n const deleteCookie = useCallback(() => {\n Cookies.remove(cookieName);\n setValue(null);\n }, [cookieName]);\n\n return [value, updateCookie, deleteCookie];\n};\n\nexport default useCookie;\n","import { useState, useEffect, useCallback } from 'react';\nimport { useHistory } from 'react-router-dom';\n\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { isSuperOrEcustosAdmin } from 'shared/roles';\nimport { toast } from 'shared/toast';\n\nimport { UserOrganization } from 'types/access-control';\n\nimport useCookies from './useCookies';\n\nexport type Organization = UserOrganization['managed_organization'];\n\nexport interface Auth {\n user: UserOrganization;\n token: string | null;\n jwtManagement: string | null;\n validating: boolean;\n loading: boolean;\n authenticated: boolean;\n userOrganizations: Organization[];\n handleLogin(email: string, password: string): Promise;\n handleTwoFactorAuth(email: string, code: string): Promise;\n handleSelectOrganization(\n organizationId: number,\n userId: number,\n organizationJwt: string,\n ): Promise;\n shouldRedirectToAnotherFrontend(organization: Organization): boolean;\n handleLogout(): void;\n getAuth(): Promise;\n}\n\nconst domain = process.env.NODE_ENV === 'development' ? '' : '.ecustos.com.br';\n\nconst cookieOptions = {\n path: '/',\n domain,\n expires: 15, // 15 days\n};\n\nconst getCookieKeys = (): [string, string] => {\n const env = process.env.REACT_APP_ECUSTOS_ENV;\n\n if (env === 'production') {\n return ['ecustos-auth-prd', 'ecustos-jwt-prd'];\n }\n\n if (env === 'staging') {\n return ['ecustos-auth-stg', 'ecustos-jwt-stg'];\n }\n\n return ['ecustos-auth-dev', 'ecustos-jwt-dev'];\n};\n\nfunction useAuth(): Auth {\n const history = useHistory();\n\n const [loading, setLoading] = useState(false);\n const [authenticated, setAuthenticated] = useState(false);\n\n const [cookieTokenKey, cookieJwtKey] = getCookieKeys();\n\n const [token, setToken, removeToken] = useCookies(cookieTokenKey);\n const [jwtManagement, setJwt, removeJwt] = useCookies(cookieJwtKey);\n\n const [userOrganizations, setUserOrganizations] = useState(\n [],\n );\n\n const [validating, setValidating] = useState(true);\n\n const [user, setUser] = useState({} as UserOrganization);\n\n const shouldRedirectToAnotherFrontend = useCallback(\n ({ organization }: Organization): boolean => {\n if (!organization.url) {\n return false;\n }\n\n if (process.env.NODE_ENV === 'development') {\n return false;\n }\n\n const currentFrontend = window.location.href;\n const targetFrontend = organization.url;\n\n const currentUrl = new URL(currentFrontend);\n const targetUrl = new URL(targetFrontend);\n\n return currentUrl.hostname !== targetUrl.hostname;\n },\n [],\n );\n\n const getAuth = useCallback(async () => {\n setValidating(true);\n\n try {\n const { data: userInfo } = await api.get('/auth');\n\n const userOrganization = userInfo.data?.managed_organization;\n\n if (\n userOrganization &&\n shouldRedirectToAnotherFrontend(userOrganization)\n ) {\n window.location.href = userOrganization.organization.url;\n }\n\n setUser(userInfo.data);\n setAuthenticated(true);\n } catch (err) {\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n\n delete api.defaults.headers.Authorization;\n delete api.defaults.headers.common['JWT-Management'];\n\n toast({\n description: 'Sessão expirada! Faça login novamente.',\n status: 'warning',\n });\n } finally {\n setValidating(false);\n }\n }, [\n removeToken,\n removeJwt,\n setUser,\n setAuthenticated,\n shouldRedirectToAnotherFrontend,\n ]);\n\n const getUserOrganizationDefault = useCallback(\n async (organizationId = null, userId = null) => {\n setLoading(true);\n\n try {\n const { data: userInfo } = await api.get('/user/organization/default', {\n params: {\n ...(organizationId && { organization_id: organizationId }),\n ...(userId && { user_id: userId }),\n },\n });\n return userInfo.data;\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data.message ||\n 'Houve um erro ao buscar as informações do usuário.',\n status: 'error',\n });\n\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n }\n } finally {\n setLoading(false);\n }\n\n return null;\n },\n [removeToken, removeJwt, setUser, setAuthenticated],\n );\n\n const handleSelectOrganization = useCallback(\n async (organizationId, userId, organizationJwt) => {\n api.defaults.headers.common['JWT-Management'] = organizationJwt;\n await getUserOrganizationDefault(organizationId, userId);\n\n setJwt(organizationJwt, cookieOptions);\n setAuthenticated(true);\n },\n [setJwt, setAuthenticated, getUserOrganizationDefault],\n );\n\n const getUserOrganizations = useCallback(\n async (userId) => {\n setLoading(true);\n\n try {\n const { data: userOrganizationsLoaded } = await api.get(\n '/organization/user',\n {\n params: {\n page: 1,\n per_page: 100,\n 'filter[user_id]': userId,\n },\n },\n );\n\n if (userOrganizationsLoaded.data.length === 1) {\n const [userOrganization] = userOrganizationsLoaded.data;\n const organizationId = userOrganization.organization.id;\n const organizationJwt = userOrganization.jwt_management;\n\n if (shouldRedirectToAnotherFrontend(userOrganization)) {\n window.location.href = userOrganization.organization.url;\n }\n\n await handleSelectOrganization(\n organizationId,\n userId,\n organizationJwt,\n );\n\n history.push('/');\n\n return;\n }\n\n setUserOrganizations(userOrganizationsLoaded.data);\n\n history.push('/organization');\n } catch (err) {\n toast({\n description:\n err.response?.data.message ||\n 'Houve um erro ao buscar as informações do usuário.',\n status: 'error',\n });\n\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n\n delete api.defaults.headers.Authorization;\n delete api.defaults.headers.common['JWT-Management'];\n } finally {\n setLoading(false);\n }\n },\n [\n history,\n handleSelectOrganization,\n removeToken,\n removeJwt,\n setUser,\n setAuthenticated,\n shouldRedirectToAnotherFrontend,\n ],\n );\n\n const handleLogout = useCallback(\n (force?: boolean): void => {\n setValidating(true);\n\n try {\n if (!force) {\n api.delete('/auth');\n }\n } finally {\n setValidating(false);\n setAuthenticated(false);\n removeToken();\n removeJwt();\n setUser({} as UserOrganization);\n\n delete api.defaults.headers.Authorization;\n delete api.defaults.headers.common['JWT-Management'];\n\n history.push('/');\n }\n },\n [history, removeToken, removeJwt],\n );\n\n const handleLogin = async (\n email: string,\n password: string,\n ): Promise => {\n try {\n await api.post('/auth', {\n email,\n password,\n });\n\n history.push(`/2fa?email=${encodeURIComponent(email)}`);\n } catch (err) {\n if (isAxiosError(err)) {\n const message =\n err.response?.data.message ||\n 'Houve um erro inesperado ao realizar o login.';\n throw new Error(message);\n }\n }\n };\n\n const handleTwoFactorAuth = async (\n email: string,\n code: string,\n ): Promise => {\n try {\n const authUser = await api.post('/auth/code', {\n email,\n code,\n });\n\n const accessToken = authUser.data?.accessToken;\n const userId = authUser.data?.token.user_id;\n\n if (accessToken) {\n api.defaults.headers.Authorization = `Bearer ${accessToken}`;\n setToken(accessToken, cookieOptions);\n\n const userInfo = await getUserOrganizationDefault(null, null);\n\n if (isSuperOrEcustosAdmin(userInfo)) {\n getAuth();\n history.push('/');\n } else {\n getUserOrganizations(userId);\n }\n }\n } catch (err) {\n if (isAxiosError(err)) {\n const message =\n err.response?.data.message ||\n 'Houve um erro inesperado ao realizar o login.';\n throw new Error(message);\n }\n }\n };\n\n useEffect(() => {\n if (token && jwtManagement) {\n api.defaults.headers.Authorization = `Bearer ${token}`;\n api.defaults.headers.common['JWT-Management'] = jwtManagement;\n\n getAuth().then(() => {\n // history.push('/');\n });\n } else {\n setValidating(false);\n setAuthenticated(false);\n setUser({} as UserOrganization);\n }\n }, [token, jwtManagement, getAuth, history]);\n\n useEffect(() => {\n if (user.id) {\n const wehelpCustomerInfo = {\n debug: 1,\n survey_token:\n 'OGIzY2E3YzI3ZGNjMGI5ODA4OTRhZDFiNmJiZWFiZjE5NWVlOWU5YzEwOWJhM2MwZTE2NzhkMTY5ZGJkNGVjOanRNWS2dU7ECnOEMKmvbYfwAGkqzTiRc1iYxa3Vzc_B',\n type: 'bar',\n message_open: 0,\n language: 'PORTUGUESE',\n company_unit: '1',\n experience_id: null,\n person: {\n internal_code: user.id,\n name: user.name,\n email: user.email,\n type: 'CUSTOMER',\n language: 'PORTUGUESE',\n company_unit: '1',\n },\n custom_fields: [\n {\n name: 'Onde você conheceu o ecustos?',\n value: 'origin_from',\n },\n ],\n };\n\n if (window.loadWeHelpWidgetScreen) {\n loadWeHelpWidgetScreen(\n 'https://app.wehelpsoftware.com',\n wehelpCustomerInfo,\n 'root-wehelp',\n );\n }\n }\n }, [user]);\n\n return {\n authenticated,\n user,\n validating,\n token,\n jwtManagement,\n userOrganizations,\n loading,\n handleLogin,\n handleTwoFactorAuth,\n handleSelectOrganization,\n shouldRedirectToAnotherFrontend,\n handleLogout,\n getAuth,\n };\n}\n\nexport type { UserOrganization };\nexport default useAuth;\n","import React, { createContext } from 'react';\n\nimport useAuth, { Auth, UserOrganization } from 'hooks/useAuth';\n\nconst AuthContext = createContext({} as Auth);\n\nexport const AuthProvider: React.FC = ({ children }) => {\n const auth = useAuth();\n\n return {children};\n};\n\nexport type { UserOrganization };\nexport default AuthContext;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { Plus as PlusIcon } from '@styled-icons/bootstrap/Plus';\nimport { DollarSign as DollarSignIcon } from '@styled-icons/fa-solid/DollarSign';\nimport { Refresh as RefreshIcon } from '@styled-icons/material-twotone/Refresh';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n Flex,\n Text,\n Box,\n useMediaQuery,\n ModalFooter,\n HStack,\n Button,\n Icon,\n IconButton,\n ModalCloseButton,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport SummaryContainer from 'components/SummaryContainer';\nimport SummaryDataChartCard from 'components/SummaryDataChartCard';\n\nimport useModal from 'hooks/useModal';\n\nimport { Budget } from 'types/budget';\n\nimport FragmentsTable, { FragmentSummary } from './FragmentsTable';\n\ntype Props = ModalRootProps & {\n data: {\n id: number;\n budget_id: number;\n budget_bases: Budget['bases'];\n locale_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n code: string;\n base: string;\n description: string;\n price: number;\n classification: string;\n type: string;\n unit_measure: string;\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\ntype LoadFragmentsFn = () => Promise;\nlet loadFragmentsFn: LoadFragmentsFn;\n\nconst ModalCompositionEdit: React.FC = ({\n data,\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [loading, setLoading] = useState(false);\n const [summary, setSummary] = useState(\n {} as FragmentSummary,\n );\n\n const { openModal } = useModal();\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const getSummary = useCallback(async () => {\n setLoading(true);\n setSummary({} as FragmentSummary);\n\n try {\n const { data: response } = await api.get(\n `budget/${data.budget_id}/composition/${data.id}/price`,\n {\n params: {\n 'filter[locale_id]': data.locale_id,\n 'filter[price_type_id]': data.price_type_id,\n },\n },\n );\n\n const [summaryLoaded] = response.data;\n\n setSummary({\n total: summaryLoaded.total,\n material: summaryLoaded.material,\n material_percent: summaryLoaded.material_percent,\n equipment: summaryLoaded.equipment,\n equipment_percent: summaryLoaded.equipment_percent,\n labor: summaryLoaded.labor,\n labor_percent: summaryLoaded.labor_percent,\n third_party: summaryLoaded.third_party,\n third_party_percent: summaryLoaded.third_party_percent,\n other: summaryLoaded.other,\n other_percent: summaryLoaded.other_percent,\n });\n } catch (err) {\n setSummary({} as FragmentSummary);\n } finally {\n setLoading(false);\n }\n }, [data]);\n\n useEffect(() => {\n getSummary();\n }, [getSummary]);\n\n const registerLoadFragments = useCallback((fn: LoadFragmentsFn) => {\n loadFragmentsFn = fn;\n }, []);\n\n const handleConfirm = (): void => {\n if (onConfirm) {\n onConfirm();\n }\n\n handleClose();\n };\n\n return (\n \n \n \n Editar composição\n\n \n\n \n \n \n \n\n \n \n Código\n \n {data.code} / {data.base}\n \n \n\n \n Descrição\n \n {data.description}\n \n \n \n\n \n \n Valor unitário\n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(summary.total || 0)}\n \n \n\n \n Classe\n \n {data.classification}\n \n \n\n \n Tipo\n \n {data.type}\n \n \n\n \n Unidade\n \n {data.unit_measure}\n \n \n \n\n \n }\n colorScheme=\"orange\"\n size=\"md\"\n onClick={() => {\n openModal('budgetCompositionFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: data.budget_id,\n compositionId: data.id,\n bases: data.budget_bases,\n },\n onConfirm: () => {\n loadFragmentsFn();\n getSummary();\n },\n });\n }}\n >\n Adicionar composição\n \n\n }\n size=\"md\"\n onClick={() => {\n openModal('budgetInputFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: data.budget_id,\n compositionId: data.id,\n bases: data.budget_bases,\n },\n onConfirm: () => {\n loadFragmentsFn();\n getSummary();\n },\n });\n }}\n >\n Adicionar insumo\n \n\n }\n isLoading={loading}\n isDisabled={loading}\n onClick={() => {\n loadFragmentsFn();\n getSummary();\n }}\n />\n \n\n \n \n\n \n \n \n Finalizar\n \n \n \n \n \n );\n};\n\nexport default ModalCompositionEdit;\n","import React, { Suspense, lazy, useContext, useEffect } from 'react';\nimport { withRouter, useLocation } from 'react-router-dom';\n\nimport FallbackSpinner from 'components/FallbackSpinner';\n\nimport AuthContext from 'contexts/AuthContext';\nimport { SidebarProvider } from 'contexts/SidebarContext';\n\nconst AuthRoutes = lazy(() => import('./AuthRoutes'));\nconst AppRoutes = lazy(() => import('./AppRoutes'));\n\nconst Routes: React.FC = () => {\n const location = useLocation();\n\n const { authenticated, validating } = useContext(AuthContext);\n\n useEffect(() => {\n window.scrollTo({ top: 0 });\n\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n }, [location.pathname]);\n\n if (validating) {\n return ;\n }\n\n return (\n }>\n \n {authenticated ? : }\n \n \n );\n};\n\nexport default withRouter(Routes);\n","import DangerDeleteAlert from 'components/Alert/DangerDelete';\nimport GenericAlert from 'components/Alert/Generic';\n\nexport default {\n genericAlert: GenericAlert,\n dangerDeleteAlert: DangerDeleteAlert,\n};\n","import React, { useMemo } from 'react';\n\nimport { InfoCircleFill as InfoCircleIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { Warning as WarningIcon } from '@styled-icons/fluentui-system-filled/Warning';\n\nimport {\n AlertDialog,\n AlertDialogBody,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogContent,\n AlertDialogOverlay,\n AlertDialogCloseButton,\n Button,\n Icon,\n} from '@chakra-ui/react';\n\nimport { AlertRootProps } from 'components/Alert/Root';\n\nconst GenericAlert: React.FC = ({\n type,\n title,\n description,\n buttons,\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const cancelRef = React.useRef(null);\n\n const getAlertDescription = (\n descr?: string | (() => JSX.Element),\n ): string | JSX.Element => {\n if (descr) {\n return typeof descr === 'string' ? descr : descr();\n }\n\n return '';\n };\n\n const icon = useMemo((): JSX.Element => {\n if (type === 'danger') {\n return ;\n }\n\n if (type === 'warning') {\n return ;\n }\n\n return ;\n }, [type]);\n\n const colorScheme = useMemo(() => {\n if (type === 'danger') {\n return 'red';\n }\n\n if (type === 'warning') {\n return 'orange';\n }\n\n return 'blue';\n }, [type]);\n\n return (\n \n \n\n \n \n {icon} {title}\n \n\n \n\n {getAlertDescription(description)}\n\n \n \n\n {\n if (onConfirm) onConfirm();\n handleClose();\n }}\n >\n {buttons?.[1] || 'Confirmar'}\n \n \n \n \n );\n};\n\nexport default GenericAlert;\n","import React from 'react';\n\nimport { InfoCircleFill as InfoCircleIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { Warning as WarningIcon } from '@styled-icons/fluentui-system-filled/Warning';\n\nimport {\n AlertDialog,\n AlertDialogBody,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogContent,\n AlertDialogOverlay,\n AlertDialogCloseButton,\n Button,\n Icon,\n Text,\n Input,\n} from '@chakra-ui/react';\n\nimport { AlertRootProps } from 'components/Alert/Root';\n\ninterface DangerDeleteAlertProps extends AlertRootProps {\n data: {\n confirmText: string;\n };\n}\n\nconst DangerDeleteAlert: React.FC = ({\n type,\n title,\n description,\n buttons,\n data,\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [inputValue, setInputValue] = React.useState('');\n const confirmText = data?.confirmText || 'excluir';\n\n const cancelRef = React.useRef(null);\n\n const getAlertDescription = (\n descr?: string | (() => JSX.Element),\n ): string | JSX.Element => {\n if (descr) {\n return typeof descr === 'string' ? descr : descr();\n }\n\n return '';\n };\n\n const isConfirmTextValid =\n inputValue.localeCompare(confirmText, undefined, {\n sensitivity: 'accent',\n }) === 0;\n\n return (\n \n \n\n \n \n {type === 'danger' ? (\n \n ) : (\n \n )}{' '}\n {title}\n \n\n \n\n \n <>\n {getAlertDescription(description)}\n\n \n Para confirmar a exclusão digite {confirmText} no\n campo abaixo:\n \n\n setInputValue(e.target.value)}\n />\n \n \n\n \n \n\n {\n if (onConfirm) onConfirm();\n handleClose();\n }}\n >\n {buttons?.[1] || 'Confirmar'}\n \n \n \n \n );\n};\n\nexport default DangerDeleteAlert;\n","import React from 'react';\n\nimport useAlert, { AlertProps } from 'hooks/useAlert';\n\nimport alertList from './alertList';\n\nexport interface AlertRootProps extends AlertProps {\n handleClose: () => void;\n}\n\nexport type AlertKey = keyof typeof alertList;\n\nconst AlertRoot: React.FC = () => {\n const { alerts, closeAlert } = useAlert();\n\n return (\n <>\n {alerts.map(({ key, props }) => {\n const Component = alertList[key];\n\n if (!Component) return null;\n\n return (\n closeAlert(key)}\n handleClose={() => closeAlert(key)}\n closeOnOverlayClick={false}\n {...props}\n />\n );\n })}\n \n );\n};\n\nexport default AlertRoot;\n","import React, { useCallback, useState } from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Input,\n HStack,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nconst ModalABCValues: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [valueA, setValueA] = useState(50);\n const [valueB, setValueB] = useState(80);\n const [valueC, setValueC] = useState(100);\n\n const handleSubmitValues = useCallback(async () => {\n if (onConfirm) onConfirm(valueA, valueB, valueC);\n handleClose();\n }, [handleClose, onConfirm, valueA, valueB, valueC]);\n\n return (\n \n \n \n Curva ABC\n\n \n\n \n *': {\n marginY: 1,\n },\n }}\n >\n \n \n Índice A\n\n {\n setValueA(v.floatValue || 0);\n }}\n />\n \n\n \n Índice B\n\n {\n setValueB(v.floatValue || 0);\n }}\n />\n \n\n \n Índice C\n\n {\n setValueC(v.floatValue || 0);\n }}\n />\n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n};\n\nexport default ModalABCValues;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n FormErrorMessage,\n SimpleGrid,\n Checkbox,\n Select,\n Tooltip,\n Icon,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect, { SelectedValues } from 'components/OwnSelect';\n\nimport { State } from 'types/address';\nimport { Locale } from 'types/base';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalBaseAddProps extends ModalRootProps {\n data: {\n base_id?: number;\n description?: string;\n use_social_law?: boolean;\n };\n}\n\ntype PriceType = 'taxed,untaxed' | 'default';\n\nconst ModalBaseAdd: React.FC = ({\n onConfirm,\n handleClose,\n data = {},\n mode,\n ...restProps\n}) => {\n const [description, setDescription] = useState(\n data.description || '',\n );\n\n const [modelType] = useState('sinapi');\n\n const descriptionRef = React.useRef(null);\n const [useSocialLaw, setUseSocialLaw] = useState(\n data.use_social_law || false,\n );\n\n const [isAllStates, setIsAllStates] = useState(false);\n const [stateSelected, setStateSelected] = useState([]);\n const [localeList, setLocaleList] = useState([]);\n const [stateList, setStateList] = useState([]);\n\n const [selectedPriceType, setSelectedPriceType] =\n useState('default');\n\n const [loading, setLoading] = useState(false);\n const [isFindingStates, setIsFindingStates] = useState(false);\n const [isFindingLocales, setIsFindingLocales] = useState(false);\n const [, setIsFindingPriceTypes] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (descriptionRef.current) {\n descriptionRef.current.focus();\n }\n }, []);\n\n const statesToSelect = useMemo(\n () =>\n stateList.map((state) => ({\n value: state.id,\n label: state.name,\n })),\n [stateList],\n );\n\n const getStates = useCallback(async () => {\n setIsFindingStates(true);\n try {\n const { data: responseStates } = await api.get(`/state`);\n const states = responseStates.data;\n setStateList(states);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar a lista de estados.',\n status: 'error',\n });\n } finally {\n setIsFindingStates(false);\n }\n }, []);\n\n useEffect(() => {\n getStates();\n }, [getStates]);\n\n const getLocales = useCallback(async () => {\n setIsFindingLocales(true);\n try {\n const { data: responseLocales } = await api.get('/locale', {\n params: {\n 'filter[status]': 'active',\n 'filter[base_id]': data.base_id,\n sort: 'description',\n },\n });\n const locales = responseLocales.data;\n setLocaleList(locales);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar a lista de estados.',\n status: 'error',\n });\n } finally {\n setIsFindingLocales(false);\n }\n }, [data]);\n\n useEffect(() => {\n if (data.base_id) {\n getLocales();\n }\n }, [getLocales, data]);\n\n const getPriceTypes = useCallback(async () => {\n setIsFindingPriceTypes(true);\n try {\n const { data: responsePriceTypes } = await api.get('/price/type', {\n params: {\n 'filter[status]': 'active',\n 'filter[base_id]': data.base_id,\n sort: 'description',\n },\n });\n const locales = responsePriceTypes.data;\n if (locales.length === 2) {\n setSelectedPriceType('taxed,untaxed');\n } else {\n setSelectedPriceType('default');\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar a lista de estados.',\n status: 'error',\n });\n } finally {\n setIsFindingPriceTypes(false);\n }\n }, [data]);\n\n useEffect(() => {\n if (data.base_id) {\n getPriceTypes();\n }\n }, [getPriceTypes, data]);\n\n useEffect(() => {\n if (localeList.length > 0 && stateList.length > 0) {\n const localesIds = stateList\n .filter((state) =>\n localeList.some((locale) => locale.key === state.abbreviation),\n )\n .map((state) => state.id);\n setStateSelected(localesIds);\n }\n }, [localeList, stateList]);\n\n const getStatesNameById = useCallback(\n (stateId: number[]) => {\n const states = stateList.filter((state) => stateId.includes(state.id));\n return states.map((state) => ({\n key: state.abbreviation,\n description: state.name,\n }));\n },\n [stateList],\n );\n\n useEffect(() => {\n if (stateSelected.length === statesToSelect.length) {\n setIsAllStates(true);\n } else {\n setIsAllStates(false);\n }\n }, [stateSelected, statesToSelect]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (stateSelected.length === 0) {\n Object.assign(formErrors, { states: true, type: 'required' });\n }\n\n if (!description) {\n Object.assign(formErrors, { description: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n if (mode === 'add') {\n const { data: newBase } = await api.post(`/base`, {\n key: 'own',\n description,\n model_type: modelType,\n use_social_law: useSocialLaw,\n locales: getStatesNameById(stateSelected),\n price_types:\n selectedPriceType === 'default'\n ? [{ key: 'default', description: 'Padrão' }]\n : [\n {\n key: 'taxed',\n description: 'Não Desonerado',\n },\n {\n key: 'untaxed',\n description: 'Desonerado',\n },\n ],\n });\n\n const newBaseId = newBase.data.id;\n\n await api.post(`/version`, {\n base_id: newBaseId,\n description: 'Ref. Padrão',\n });\n } else if (mode === 'edit') {\n await api.put(`/base/${data.base_id}`, {\n key: 'own',\n description,\n model_type: modelType,\n use_social_law: useSocialLaw,\n locales: getStatesNameById(stateSelected),\n });\n }\n\n if (onConfirm) onConfirm();\n\n toast({\n description:\n mode === 'add'\n ? 'Base adicionada com sucesso!'\n : 'Base editada com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n (mode === 'add'\n ? 'Houve um erro ao adicionar a base!'\n : 'Houve um erro ao editar a base!'),\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {mode === 'add' ? 'Adicionar base' : 'Editar base'}\n \n\n \n\n \n \n \n Descrição\n\n setDescription(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.description && 'Descrição é obrigatória'}\n \n \n\n \n Modelo\n\n \n\n \n {!!errors?.modelType && 'Modelo é obrigatório'}\n \n \n \n \n \n Estado{' '}\n {\n setIsAllStates(e.target.checked);\n if (e.target.checked) {\n setStateSelected(\n statesToSelect.map((state) => state.value),\n );\n }\n }}\n size=\"sm\"\n />{' '}\n Todos os estados\n \n\n \n stateSelected.includes(s.value),\n )}\n isLoading={isFindingStates || isFindingLocales}\n isDisabled={\n isFindingStates ||\n isFindingLocales ||\n statesToSelect.length === 0\n }\n isClearable\n onChange={(selected: SelectedValues) => {\n const value = selected.map((s) => Number(s.value));\n setStateSelected(value);\n }}\n />\n Estado é obrigatório\n \n \n Tipo de preço\n\n \n setSelectedPriceType(e.target.value as PriceType)\n }\n isDisabled={mode === 'edit'}\n _disabled={{\n background: 'hsl(0, 0%, 95%)',\n border: '1px solid hsl(0, 0%, 90%)',\n }}\n >\n \n \n \n Estado é obrigatório\n \n\n setUseSocialLaw(e.target.checked)}\n >\n Campo de leis sociais (%){' '}\n \n \n \n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalBaseAdd;\n","import React, {\n useState,\n useEffect,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Base } from 'types/base';\n\nconst ModalBaseSelect: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n const [bases, setBases] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [selectedBase, setSelectedBase] = useState();\n\n const getBases = useCallback(async () => {\n setLoading(true);\n\n try {\n const { data: basesLoaded } = await api.get('/base/list', {\n params: {\n 'filter[with_plan]': `.`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n sort: 'description',\n },\n });\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : undefined;\n setSelectedBase(value);\n };\n\n const handleConfirm = (): void => {\n const base = bases.find((item) => item.id === selectedBase);\n\n if (!base) {\n toast({\n description: 'Selecione uma base!',\n status: 'warning',\n });\n\n return;\n }\n\n if (onConfirm) onConfirm(base);\n handleClose();\n };\n\n return (\n \n \n \n Selecionar base de dados\n\n \n\n \n Number(s.value) === selectedBase,\n )}\n isLoading={loading}\n isDisabled={loading || basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n \n\n \n \n Selecionar\n \n \n \n \n );\n};\n\nexport default ModalBaseSelect;\n","import React, { useCallback, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Heading,\n Textarea,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport { Composition } from 'pages/Budget/Add/SubPages/Planning/types';\n\ntype BudgetComponent = Composition;\n\ninterface ModalBudgetComponentObservationProps extends ModalRootProps {\n data: {\n budgetId: number;\n component: BudgetComponent;\n };\n}\n\nconst ModalBudgetCompositionObservation: React.FC =\n ({ onConfirm, handleClose, data: { budgetId, component }, ...restProps }) => {\n const [observation, setObservation] = useState(component.observation);\n const [loading, setLoading] = useState(false);\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.put(`budget/${budgetId}/component/${component.id}`, {\n type: 'composition_original',\n component: {\n quantity: component.quantity,\n observation,\n composition_price_id: component.composition_price?.id,\n },\n });\n\n toast({\n description: 'Composição alterada com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao editar a composição.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [budgetId, component, observation, handleClose, onConfirm]);\n\n return (\n \n \n \n Editar Composição\n\n \n\n \n *': {\n marginY: 1,\n },\n }}\n >\n \n Componente do orçamento:{' '}\n {component.composition_price?.composition.description}\n \n\n \n \n Memória de cálculo\n\n setObservation(e.target.value)}\n placeholder=\"Digite a memória de cálculo\"\n size=\"lg\"\n resize=\"none\"\n />\n \n \n \n \n\n \n \n Confirmar\n \n \n \n \n );\n };\n\nexport default ModalBudgetCompositionObservation;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps, TableCellProps } from '@chakra-ui/react';\n\nimport { Cell, FragmentResource, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n nextComponentId: number;\n nextComponentPriceTypeKey: string;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst FragmentTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original.fragment_type;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n const getCustomCellProps = (cell: Cell): TableCellProps => {\n return {\n onClick: (e) => {\n e.stopPropagation();\n if (cell.column.id !== 'coefficient' && cell.column.id !== 'actions') {\n row.toggleRowExpanded();\n }\n },\n };\n };\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n nextComponentId: row.original.fragment.id,\n nextComponentPriceTypeKey: row.original.price_type?.key,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default FragmentTableRow;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport InputNumberFormat from 'react-number-format';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { Plus as PlusIcon } from '@styled-icons/bootstrap/Plus';\nimport { Cog as CogIcon } from '@styled-icons/boxicons-solid/Cog';\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { Save as SaveIcon } from '@styled-icons/boxicons-solid/Save';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Icon,\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Flex,\n Box,\n Skeleton,\n InputGroup,\n InputRightAddon,\n Input,\n IconButton,\n Menu,\n MenuButton,\n MenuList,\n MenuItem,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport useAlert from 'hooks/useAlert';\nimport useModal from 'hooks/useModal';\n\nimport { Budget } from 'types/budget';\n\nimport FragmentTableRow from './FragmentsTableRow';\nimport { FragmentResource, Row } from './types';\n\nexport type FragmentSummary = {\n total: number;\n material: number;\n material_percent: number;\n equipment: number;\n equipment_percent: number;\n labor: number;\n labor_percent: number;\n third_party: number;\n third_party_percent: number;\n other: number;\n other_percent: number;\n};\n\ntype QttySummary = {\n total_compositions: number;\n total_inputs: number;\n};\n\ntype Props = {\n budget_id: number;\n budget_bases: Budget['bases'];\n component_id: number;\n locale_key: string;\n locale_id: number;\n price_type_id: number;\n price_type_key: string;\n isSubRow?: boolean;\n parentFragments?: FragmentResource[];\n parentQttySummary?: QttySummary;\n registerLoadFragments?: (fn: () => Promise) => void;\n reloadTable: () => void;\n getSummary: () => void;\n};\n\ntype IsEditingFragment = {\n [id: number]: {\n coefficient: boolean;\n price: boolean;\n };\n};\n\nconst FragmentsTable: React.FC = ({\n isSubRow = false,\n parentFragments = [],\n registerLoadFragments,\n budget_id,\n budget_bases,\n component_id,\n locale_id,\n locale_key,\n price_type_id,\n price_type_key,\n getSummary,\n reloadTable,\n}) => {\n const { openModal } = useModal();\n const { openAlert } = useAlert();\n\n const [fragments, setFragments] = useState([]);\n const [isEditingFragment, setIsEditingFragment] = useState(\n {},\n );\n\n const [qttySummary, setQttySummary] = useState(\n {} as QttySummary,\n );\n const [loading, setLoading] = useState(false);\n\n const getData = useCallback(async () => {\n setLoading(true);\n\n try {\n const response = await api.get(\n `budget/${budget_id}/composition/${component_id}/component/fragment`,\n {\n params: {\n page: 1,\n per_page: 999,\n 'filter[locale_key]': locale_key,\n 'filter[price_type_key]': price_type_key,\n },\n },\n );\n\n const fragmentsLoaded = response.data;\n\n const newQttySummary = {\n total_compositions: fragmentsLoaded.summary.total.total_compositions,\n total_inputs: fragmentsLoaded.summary.total.total_inputs,\n };\n\n setFragments(\n fragmentsLoaded.data.map((i: FragmentResource) => ({\n ...i,\n newQuantity: i.coefficient,\n newUnitPrice: i.unit_price,\n })),\n );\n setQttySummary(newQttySummary);\n } catch (err) {\n setFragments([]);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar o mapeamento da composição.',\n status: 'error',\n });\n setQttySummary({} as QttySummary);\n } finally {\n setLoading(false);\n }\n }, [component_id, locale_key, price_type_key, budget_id]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const isInput = (data: FragmentResource): boolean => {\n return data.fragment_type.includes('input');\n };\n\n const getType = (row: Row): string => {\n return row.original.fragment_type;\n };\n\n const getIcon = (row: Row): MdiReactIconComponentType => {\n if (getType(row).includes('input')) {\n return InfoIcon;\n }\n\n return GroupIcon;\n };\n\n const shouldShowInputIcon = (i: FragmentResource): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i.fragment.classification.key);\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: FragmentResource): InputIcon => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputIconType = useCallback((i: FragmentResource): string => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const handleRemoveFragment = useCallback(\n (resource: FragmentResource): void => {\n openAlert({\n type: 'danger',\n title: 'Excluir fragmento',\n description: () => (\n \n Você está prestes a excluir um fragmento da composição.\n {resource.fragment.description}\n Deseja realmente realizar essa ação?\n \n ),\n buttons: ['Cancelar', 'Excluir'],\n onConfirm: async () => {\n try {\n await api.delete(\n `budget/${budget_id}/composition/${component_id}/component/fragment/${resource.id}`,\n );\n\n toast({\n description: 'Fragmento removido com sucesso!',\n status: 'success',\n });\n\n if (!reloadTable) {\n setFragments((oldFragments) => {\n const newFragments = [...oldFragments];\n const index = newFragments.findIndex(\n (i) => i.id === resource.id,\n );\n\n newFragments.splice(index, 1);\n\n return newFragments;\n });\n } else {\n reloadTable();\n }\n\n getSummary();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao excluir o fragmento.',\n status: 'error',\n });\n }\n },\n });\n },\n [reloadTable, openAlert, budget_id, component_id, getSummary],\n );\n\n const handleUpdateQuantity = useCallback(\n async (component) => {\n if (!component.newQuantity) {\n toast({\n description: 'A quantidade deve ser maior que zero.',\n status: 'error',\n });\n return;\n }\n\n setLoading(true);\n\n try {\n await api.put(\n `budget/${budget_id}/composition/${component_id}/component/fragment/${component.id}`,\n {\n fragment: {\n coefficient: component.newQuantity,\n },\n },\n );\n\n toast({\n description: 'Fragmento alterado com sucesso!',\n status: 'success',\n });\n\n reloadTable();\n getSummary();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao editar o fragmento.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n },\n [budget_id, getSummary, reloadTable, component_id],\n );\n\n const handleUpdateUnitPrice = useCallback(\n async (component) => {\n setLoading(true);\n\n try {\n await api.put(\n `budget/${budget_id}/input/${component.fragment.id}/price/${component.price_id}`,\n {\n type: 'unit',\n price_type_id,\n locale_id,\n total: component.newUnitPrice,\n },\n );\n\n toast({\n description: 'Fragmento alterado com sucesso!',\n status: 'success',\n });\n\n reloadTable();\n getSummary();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao editar o fragmento.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n },\n [budget_id, reloadTable, getSummary, locale_id, price_type_id],\n );\n\n useEffect(() => {\n if (!isSubRow && !!registerLoadFragments) {\n registerLoadFragments(getData);\n }\n }, [getData, isSubRow, registerLoadFragments]);\n\n const columns = useMemo(\n () => [\n {\n Header: () => 'Tipo',\n id: 'expander',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n \n \n \n\n {isInput(row.original) && shouldShowInputIcon(row.original) && (\n \n \n \n )}\n\n {getType(row).includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n \n );\n },\n },\n {\n Header: 'Código',\n accessor: 'data.code',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return `${row.original.fragment.code} / ${row.original.fragment.version.base.description}`;\n },\n },\n {\n Header: 'Descrição',\n accessor: 'data.description',\n width: '40%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original.fragment.description}\n \n );\n },\n },\n {\n Header: 'Unidade',\n accessor: 'data.unit_measure_id',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.fragment.unit_measure.description;\n },\n },\n {\n Header: 'Coeficiente',\n accessor: 'data.coefficient',\n id: 'coefficient',\n isNumeric: true,\n width: Object.values(isEditingFragment).some((item) => item.coefficient)\n ? '20%'\n : '1%',\n Cell: ({ row }: { row: Row }) => {\n if (isEditingFragment[row.original.id]?.coefficient) {\n return (\n \n {\n if (e.key === 'Enter') {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: false,\n },\n });\n handleUpdateQuantity(row.original);\n }\n }}\n onValueChange={(v) => {\n setFragments((oldData) => {\n const newData = [...oldData];\n const index = newData.findIndex(\n (item) => item.id === row.original.id,\n );\n newData[index].newQuantity = v.floatValue;\n return newData;\n });\n }}\n customInput={Input}\n style={{\n borderTopRightRadius: '0',\n borderBottomRightRadius: '0',\n textAlign: 'right',\n color: 'black',\n }}\n />\n\n \n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: false,\n },\n });\n\n handleUpdateQuantity(row.original);\n }}\n width=\"30px\"\n >\n \n \n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: false,\n },\n });\n }}\n width=\"30px\"\n >\n \n \n \n \n );\n }\n\n return (\n <>\n {row.original.coefficient_was_changed && (\n \n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 7,\n }).format(row.original.coefficient_original || 0)}\n \n )}\n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n coefficient: true,\n },\n });\n }}\n >\n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 7,\n }).format(row.original.coefficient || 0)}\n \n \n );\n },\n },\n {\n Header: 'Valor unitário',\n accessor: 'data.unit_value',\n isNumeric: true,\n width: Object.values(isEditingFragment).some((item) => item.price)\n ? '20%'\n : '1%',\n Cell: ({ row }: { row: Row }) => {\n if (!isInput(row.original)) {\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.unit_price || 0);\n }\n\n if (isEditingFragment[row.original.id]?.price) {\n return (\n \n {\n if (e.key === 'Enter') {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: false,\n },\n });\n\n handleUpdateUnitPrice(row.original);\n }\n }}\n onValueChange={(v) => {\n setFragments((oldData) => {\n const newData = [...oldData];\n const index = newData.findIndex(\n (item) => item.id === row.original.id,\n );\n newData[index].newUnitPrice = v.floatValue || 0;\n return newData;\n });\n }}\n customInput={Input}\n style={{\n borderTopRightRadius: '0',\n borderBottomRightRadius: '0',\n textAlign: 'right',\n color: 'black',\n }}\n />\n \n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: false,\n },\n });\n\n handleUpdateUnitPrice(row.original);\n }}\n width=\"30px\"\n >\n \n \n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: false,\n },\n });\n }}\n width=\"30px\"\n >\n \n \n \n \n );\n }\n\n return (\n <>\n {row.original.unit_price_was_changed && (\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.unit_price_original || 0)}\n \n )}\n\n {\n setIsEditingFragment({\n ...isEditingFragment,\n [row.original.id]: {\n ...isEditingFragment[row.original.id],\n price: true,\n },\n });\n }}\n >\n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.unit_price || 0)}\n \n \n );\n },\n },\n {\n Header: 'Total',\n accessor: 'data.total',\n isNumeric: true,\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: 'Ações',\n id: 'actions',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n }\n />\n\n \n {!isInput(row.original) && (\n <>\n }\n title=\"Adicionar composição\"\n color=\"black\"\n onClick={() => {\n openModal('budgetCompositionFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: budget_id,\n compositionId: row.original.fragment.id,\n bases: budget_bases,\n },\n onConfirm: () => {\n reloadTable();\n getSummary();\n },\n });\n }}\n >\n Adicionar composição\n \n\n }\n title=\"Adicionar insumo\"\n color=\"black\"\n onClick={() => {\n openModal('budgetInputFragmentSelect', {\n mode: 'select',\n data: {\n budgetId: budget_id,\n compositionId: row.original.fragment.id,\n bases: budget_bases,\n },\n onConfirm: () => {\n reloadTable();\n getSummary();\n },\n });\n }}\n >\n Adicionar insumo\n \n \n )}\n\n }\n title={\n isInput(row.original)\n ? 'Remover insumo'\n : 'Remover composição'\n }\n onClick={() => handleRemoveFragment(row.original)}\n color=\"red.600\"\n >\n {isInput(row.original)\n ? 'Remover insumo'\n : 'Remover composição'}\n \n \n \n );\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getInputIcon, isEditingFragment, reloadTable],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n // @ts-expect-error types\n columns,\n data: fragments,\n getRowId,\n autoResetExpanded: false,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ nextComponentId, nextComponentPriceTypeKey }) => (\n \n ),\n [\n locale_id,\n locale_key,\n price_type_id,\n fragments,\n budget_id,\n budget_bases,\n getSummary,\n reloadTable,\n ],\n );\n\n const parent = useMemo(() => {\n return parentFragments.find((f) => f.fragment.id === component_id);\n }, [parentFragments, component_id]);\n\n return (\n <>\n {isSubRow && (\n \n <>\n \n Classe\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.classification.description || '-'}\n )}\n \n \n\n \n Tipo de preço\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.description || '-'}\n )}\n \n \n\n \n Composições\n \n {loading ? (\n \n ) : (\n <>{qttySummary.total_compositions}\n )}\n \n \n\n \n Insumos\n \n {loading ? (\n \n ) : (\n <> {qttySummary.total_inputs}\n )}\n \n \n \n \n )}\n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && fragments.length === 0 && (\n \n \n Nenhum resultado encontrado.\n \n \n )}\n \n
\n
\n \n );\n};\n\nexport default FragmentsTable;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure, Classification, ClassificationType } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n price_type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [classifications, setClassifications] = useState([]);\n const [selectedClassification, setSelectedClassification] = useState<\n number | null\n >(null);\n const [isLoadingClassifications, setIsLoadingClassifications] =\n useState(false);\n\n const [classificationTypes, setClassificationTypes] = useState<\n ClassificationType[]\n >([]);\n const [selectedClassificationType, setSelectedClassificationType] = useState<\n number | null\n >(null);\n const [isLoadingTypes, setIsLoadingTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getClassifications = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setClassifications([]);\n return;\n }\n\n try {\n setIsLoadingClassifications(true);\n const { data: response } = await api.get('composition/classification', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const classificationsLoaded = response.data;\n setClassifications(classificationsLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingClassifications(false);\n }\n }, []);\n\n const classificationsToSelect = useMemo(() => {\n return classifications.map((classification) => ({\n value: String(classification.id),\n label: classification.description,\n }));\n }, [classifications]);\n\n useEffect(() => {\n getClassifications(selectedBase);\n }, [getClassifications, selectedBase]);\n\n const getClassificationTypes = useCallback(\n async (baseId: number | null, classificationId: number | null) => {\n if (!baseId) {\n setClassificationTypes([]);\n return;\n }\n\n try {\n setIsLoadingTypes(true);\n const { data: response } = await api.get('/composition/type', {\n params: {\n 'filter[base_id]': baseId,\n 'filter[classification_id]': classificationId,\n },\n });\n const classificationTypesLoaded = response.data;\n setClassificationTypes(classificationTypesLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingTypes(false);\n }\n },\n [],\n );\n\n const classificationTypesToSelect = useMemo(() => {\n return classificationTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [classificationTypes]);\n\n useEffect(() => {\n getClassificationTypes(selectedBase, selectedClassification);\n }, [getClassificationTypes, selectedBase, selectedClassification]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const handleClassificationChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassification(value);\n setValue('classification_id', value);\n\n if (!value) {\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n }\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Classe da composição\n\n (\n Number(s.value) === selectedClassification,\n )}\n isLoading={isLoadingClassifications}\n isDisabled={\n isLoadingClassifications ||\n classificationsToSelect.length === 0\n }\n onChange={handleClassificationChange}\n isClearable\n />\n )}\n name=\"classification_id\"\n control={control}\n />\n \n\n \n Tipo da composição\n\n (\n Number(s.value) === selectedClassificationType,\n )}\n isLoading={isLoadingTypes}\n isDisabled={\n isLoadingTypes || classificationTypesToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassificationType(value);\n setValue('classification_type_id', value);\n }}\n isClearable\n />\n )}\n name=\"classification_type_id\"\n control={control}\n />\n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n isClearable\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Input,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n Select,\n HStack,\n IconButton,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport {\n Composition,\n State,\n DefaultPrice,\n StatePrice,\n} from 'types/composition';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalCompositionFragmentSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n budgetId: number;\n compositionId: number;\n };\n}\n\ntype Fragment = {\n composition_id: number;\n coefficient: number;\n type: 'typed' | 'common';\n price_type_id: number;\n locale_key: string;\n};\n\ntype ComponentData = {\n fragments: Fragment[];\n};\n\ntype SelectedComposition = Composition & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetCompositionFragmentSelect: React.FC =\n ({\n data: { budgetId, compositionId, bases },\n handleClose,\n onConfirm,\n ...restProps\n }) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [compositions, setCompositions] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] =\n useState({ last_page: 1 });\n\n const [selectedCompositions, setSelectedCompositions] = useState<\n SelectedComposition[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (composition: Composition): number => {\n const price = getStatePrice(composition);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setCompositions([]);\n\n try {\n const response = await api.get('/composition', {\n params: {\n 'filter[resource]': 'composition',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const compositionsData = response.data;\n\n const newPagination = {\n last_page: compositionsData.meta\n ? compositionsData.meta.last_page\n : compositionsData.last_page,\n };\n\n setCompositions(compositionsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message ||\n 'Houve um erro ao buscar composições',\n });\n\n setCompositions([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComposition = (item: Composition): void => {\n setSelectedCompositions((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteComposition = (item: Composition): void => {\n setSelectedCompositions((selected) =>\n selected.filter((c) => c._id !== item._id),\n );\n };\n\n const getStatePrice = (composition: Composition): State => {\n if (!composition._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return composition._source.prices[state];\n };\n\n const getStateKey = (composition: Composition): string => {\n if (!composition._source.prices) {\n return '';\n }\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return state;\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedComposition[]): ComponentData => {\n if (!searchFilter.price_type_id) {\n return { fragments: [] };\n }\n\n return {\n fragments: selected.map((item) => ({\n composition_id: Number(item._id),\n coefficient: item.quantity || 1,\n type: 'typed',\n price_type_id: Number(searchFilter.price_type_id),\n locale_key: getStateKey(item),\n })),\n };\n },\n [searchFilter.price_type_id],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.post(\n `budget/${budgetId}/composition/${compositionId}/component/fragment`,\n {\n ...prepareComponents(selectedCompositions),\n },\n );\n\n toast({\n description: 'Composições salvas com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar as composições selecionadas.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedCompositions,\n prepareComponents,\n budgetId,\n compositionId,\n handleClose,\n onConfirm,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar composições\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedCompositions.length === 0) ||\n loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedCompositions.length > 0 && (\n \n {selectedCompositions.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectComposition(item)}\n disabled={selectedCompositions.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedCompositions.some(\n (c) => c._id === item._id,\n )\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedCompositions.some(\n (c) => c._id === item._id,\n ) && (\n }\n onClick={() => handleDeleteComposition(item)}\n />\n )}\n \n ),\n active: selectedCompositions.some(\n (c) => c._id === item._id,\n ),\n })}\n data={compositions}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedCompositions.length > 0 ? (\n selectedCompositions.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhuma composição selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedCompositions((selected) =>\n selected.map((composition) =>\n composition._id === item._id\n ? {\n ...composition,\n quantity: v.floatValue,\n }\n : composition,\n ),\n );\n }}\n customInput={Input}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() =>\n handleDeleteComposition(item)\n }\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n };\n\nexport default ModalBudgetCompositionFragmentSelect;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { FragmentResource, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n nextComponentId: number;\n nextComponentPriceTypeKey: string;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst FragmentTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original.fragment_type;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n nextComponentId: row.original.fragment.id,\n nextComponentPriceTypeKey: row.original.price_type?.key,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default FragmentTableRow;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Icon,\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Flex,\n Box,\n Skeleton,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport FragmentTableRow from './FragmentsTableRow';\nimport { FragmentResource, Row } from './types';\n\nexport type FragmentSummary = {\n total: number;\n material: number;\n material_percent: number;\n equipment: number;\n equipment_percent: number;\n labor: number;\n labor_percent: number;\n third_party: number;\n third_party_percent: number;\n other: number;\n other_percent: number;\n};\n\ntype QttySummary = {\n total_compositions: number;\n total_inputs: number;\n};\n\ntype Props = {\n budget_id: number;\n component_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n isSubRow?: boolean;\n parentFragments?: FragmentResource[];\n parentQttySummary?: QttySummary;\n};\n\nconst FragmentsTable: React.FC = ({\n isSubRow = false,\n parentFragments = [],\n component_id,\n budget_id,\n locale_key,\n price_type_id,\n price_type_key,\n}) => {\n const [fragments, setFragments] = useState([]);\n const [qttySummary, setQttySummary] = useState(\n {} as QttySummary,\n );\n const [loading, setLoading] = useState(false);\n\n const getData = useCallback(async () => {\n setLoading(true);\n setFragments([]);\n\n try {\n const response = await api.get(\n `budget/${budget_id}/composition/${component_id}/component/fragment`,\n {\n params: {\n page: 1,\n per_page: 999,\n 'filter[locale_key]': locale_key,\n 'filter[price_type_key]': price_type_key,\n },\n },\n );\n\n const fragmentsLoaded = response.data;\n\n const newQttySummary = {\n total_compositions: fragmentsLoaded.summary.total.total_compositions,\n total_inputs: fragmentsLoaded.summary.total.total_inputs,\n };\n\n setFragments(fragmentsLoaded.data);\n setQttySummary(newQttySummary);\n } catch (err) {\n setFragments([]);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar o mapeamento da composição.',\n status: 'error',\n });\n setQttySummary({} as QttySummary);\n } finally {\n setLoading(false);\n }\n }, [component_id, locale_key, price_type_key, budget_id]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const isInput = (data: FragmentResource): boolean => {\n return data.fragment_type.includes('input');\n };\n\n const getType = (row: Row): string => {\n return row.original.fragment_type;\n };\n\n const getIcon = (row: Row): MdiReactIconComponentType => {\n if (getType(row).includes('input')) {\n return InfoIcon;\n }\n\n return GroupIcon;\n };\n\n const shouldShowInputIcon = (i: FragmentResource): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i.fragment.classification.key);\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: FragmentResource): InputIcon => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputIconType = useCallback((i: FragmentResource): string => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const columns = useMemo(\n () => [\n {\n Header: () => 'Tipo',\n id: 'expander',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n \n \n \n\n {isInput(row.original) && shouldShowInputIcon(row.original) && (\n \n \n \n )}\n\n {getType(row).includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n \n );\n },\n },\n {\n Header: 'Código',\n accessor: 'data.code',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return `${row.original.fragment.code} / ${row.original.fragment.version.base.description}`;\n },\n },\n {\n Header: 'Descrição',\n accessor: 'data.description',\n width: '70%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original.fragment.description}\n \n );\n },\n },\n {\n Header: 'Unidade',\n accessor: 'data.unit_measure_id',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.fragment.unit_measure.description;\n },\n },\n {\n Header: 'Coeficiente',\n accessor: 'data.coefficient',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return (\n <>\n {row.original.coefficient_was_changed && (\n \n {row.original.coefficient_original}\n \n )}\n \n {row.original.coefficient}\n \n \n );\n },\n },\n {\n Header: 'Valor unitário',\n accessor: 'data.unit_value',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.unit_price;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: 'Total',\n accessor: 'data.total',\n isNumeric: true,\n width: '15%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getInputIcon],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n // @ts-expect-error types\n columns,\n data: fragments,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ nextComponentId, nextComponentPriceTypeKey }) => (\n \n ),\n [locale_key, price_type_id, fragments, budget_id],\n );\n\n const parent = useMemo(() => {\n return parentFragments.find((f) => f.fragment.id === component_id);\n }, [parentFragments, component_id]);\n\n return (\n <>\n {isSubRow && (\n \n <>\n \n Classe\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.classification.description || '-'}\n )}\n \n \n\n \n Tipo\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.description || '-'}\n )}\n \n \n\n \n Composições\n \n {loading ? (\n \n ) : (\n <>{qttySummary.total_compositions}\n )}\n \n \n\n \n Insumos\n \n {loading ? (\n \n ) : (\n <> {qttySummary.total_inputs}\n )}\n \n \n \n \n )}\n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && fragments.length === 0 && (\n \n \n Nenhum resultado encontrado.\n \n \n )}\n \n
\n
\n \n );\n};\n\nexport default FragmentsTable;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { DollarSign as DollarSignIcon } from '@styled-icons/fa-solid/DollarSign';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Flex,\n Text,\n Box,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport SummaryContainer from 'components/SummaryContainer';\nimport SummaryDataChartCard from 'components/SummaryDataChartCard';\n\nimport FragmentsTable, { FragmentSummary } from './FragmentsTable';\n\ntype Props = ModalRootProps & {\n data: {\n id: number;\n budget_id: number;\n locale_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n code: string;\n base: string;\n description: string;\n prices: string;\n price: number;\n classification: string;\n type: string;\n unit_measure: string;\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalBudgetCompositionLookup: React.FC = ({\n data,\n ...restProps\n}) => {\n const [loading, setLoading] = useState(false);\n const [summary, setSummary] = useState(\n {} as FragmentSummary,\n );\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const getSummary = useCallback(async () => {\n setLoading(true);\n setSummary({} as FragmentSummary);\n\n try {\n const { data: response } = await api.get(\n `budget/${data.budget_id}/composition/${data.id}/price`,\n {\n params: {\n 'filter[locale_id]': data.locale_id,\n 'filter[price_type_id]': data.price_type_id,\n },\n },\n );\n\n const [summaryLoaded] = response.data;\n\n setSummary({\n total: summaryLoaded.total,\n material: summaryLoaded.material,\n material_percent: summaryLoaded.material_percent,\n equipment: summaryLoaded.equipment,\n equipment_percent: summaryLoaded.equipment_percent,\n labor: summaryLoaded.labor,\n labor_percent: summaryLoaded.labor_percent,\n third_party: summaryLoaded.third_party,\n third_party_percent: summaryLoaded.third_party_percent,\n other: summaryLoaded.other,\n other_percent: summaryLoaded.other_percent,\n });\n } catch (err) {\n setSummary({} as FragmentSummary);\n } finally {\n setLoading(false);\n }\n }, [data]);\n\n useEffect(() => {\n getSummary();\n }, [getSummary]);\n\n return (\n \n \n \n Detalhes da composição\n\n \n\n \n \n \n \n\n \n \n Código\n \n {data.code} \\ {data.base}\n \n \n\n \n Descrição\n \n {data.description}\n \n \n \n\n \n \n Valor unitário\n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(summary.total || 0)}\n \n \n\n \n Classe\n \n {data.classification}\n \n \n\n \n Tipo\n \n {data.type}\n \n \n\n \n Unidade\n \n {data.unit_measure}\n \n \n \n\n \n \n \n \n );\n};\n\nexport default ModalBudgetCompositionLookup;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure, Classification, ClassificationType } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n price_type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [classifications, setClassifications] = useState([]);\n const [selectedClassification, setSelectedClassification] = useState<\n number | null\n >(null);\n const [isLoadingClassifications, setIsLoadingClassifications] =\n useState(false);\n\n const [classificationTypes, setClassificationTypes] = useState<\n ClassificationType[]\n >([]);\n const [selectedClassificationType, setSelectedClassificationType] = useState<\n number | null\n >(null);\n const [isLoadingTypes, setIsLoadingTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getClassifications = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setClassifications([]);\n return;\n }\n\n try {\n setIsLoadingClassifications(true);\n const { data: response } = await api.get('composition/classification', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const classificationsLoaded = response.data;\n setClassifications(classificationsLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingClassifications(false);\n }\n }, []);\n\n const classificationsToSelect = useMemo(() => {\n return classifications.map((classification) => ({\n value: String(classification.id),\n label: classification.description,\n }));\n }, [classifications]);\n\n useEffect(() => {\n getClassifications(selectedBase);\n }, [getClassifications, selectedBase]);\n\n const getClassificationTypes = useCallback(\n async (baseId: number | null, classificationId: number | null) => {\n if (!baseId) {\n setClassificationTypes([]);\n return;\n }\n\n try {\n setIsLoadingTypes(true);\n const { data: response } = await api.get('/composition/type', {\n params: {\n 'filter[base_id]': baseId,\n 'filter[classification_id]': classificationId,\n },\n });\n const classificationTypesLoaded = response.data;\n setClassificationTypes(classificationTypesLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingTypes(false);\n }\n },\n [],\n );\n\n const classificationTypesToSelect = useMemo(() => {\n return classificationTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [classificationTypes]);\n\n useEffect(() => {\n getClassificationTypes(selectedBase, selectedClassification);\n }, [getClassificationTypes, selectedBase, selectedClassification]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const handleClassificationChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassification(value);\n setValue('classification_id', value);\n\n if (!value) {\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n }\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Classe da composição\n\n (\n Number(s.value) === selectedClassification,\n )}\n isLoading={isLoadingClassifications}\n isDisabled={\n isLoadingClassifications ||\n classificationsToSelect.length === 0\n }\n onChange={handleClassificationChange}\n isClearable\n />\n )}\n name=\"classification_id\"\n control={control}\n />\n \n\n \n Tipo da composição\n\n (\n Number(s.value) === selectedClassificationType,\n )}\n isLoading={isLoadingTypes}\n isDisabled={\n isLoadingTypes || classificationTypesToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassificationType(value);\n setValue('classification_type_id', value);\n }}\n isClearable\n />\n )}\n name=\"classification_type_id\"\n control={control}\n />\n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n isClearable\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n IconButton,\n Input,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n Select,\n HStack,\n Progress,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport {\n Composition,\n State,\n DefaultPrice,\n StatePrice,\n} from 'types/composition';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalCompositionSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n subStageId: number;\n budgetId: number;\n };\n}\n\ntype Component = {\n type: 'composition_original';\n quantity: number;\n composition_id: number;\n budget_base_id: number;\n};\n\ntype ComponentData = {\n parent_stage_id: number;\n components: Component[];\n};\n\ntype SelectedComposition = Composition & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetCompositionSelect: React.FC = ({\n data: { budgetId, bases, subStageId },\n handleClose,\n onConfirm,\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [saving, setSaving] = useState(false);\n const [fakeProgress, setFakeProgress] = useState(0);\n\n const [compositions, setCompositions] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedCompositions, setSelectedCompositions] = useState<\n SelectedComposition[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (composition: Composition): number => {\n const price = getStatePrice(composition);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setCompositions([]);\n\n try {\n const response = await api.get('/composition', {\n params: {\n 'filter[resource]': 'composition',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const compositionsData = response.data;\n\n const newPagination = {\n last_page: compositionsData.meta\n ? compositionsData.meta.last_page\n : compositionsData.last_page,\n };\n\n setCompositions(compositionsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message || 'Houve um erro ao buscar composições',\n });\n\n setCompositions([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComposition = (item: Composition): void => {\n setSelectedCompositions((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteComposition = (item: Composition): void => {\n setSelectedCompositions((selected) =>\n selected.filter((c) => c._id !== item._id),\n );\n };\n\n const getStatePrice = (composition: Composition): State => {\n if (!composition._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return composition._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedComposition[]): ComponentData => {\n return {\n parent_stage_id: subStageId,\n components: selected.map((item) => ({\n type: 'composition_original',\n composition_id: Number(item._id),\n quantity: item.quantity || 0,\n budget_base_id:\n bases.find(\n (b) => b.version.base.id === item._source.version.base.id,\n )?.id || 0,\n })),\n };\n },\n [subStageId, bases],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n setSaving(true);\n setFakeProgress(0);\n\n try {\n await api.post(`budget/${budgetId}/component`, {\n ...prepareComponents(selectedCompositions),\n });\n\n toast({\n description: 'Composições salvas com sucesso!',\n status: 'success',\n });\n\n setFakeProgress(99);\n\n setTimeout(() => {\n if (onConfirm) onConfirm();\n handleClose();\n }, 1000);\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar as composições selecionadas.',\n status: 'error',\n });\n }\n } finally {\n setSaving(false);\n setLoading(false);\n }\n }, [\n selectedCompositions,\n prepareComponents,\n budgetId,\n handleClose,\n onConfirm,\n ]);\n\n useEffect(() => {\n if (saving) {\n const interval = setInterval(() => {\n setFakeProgress((oldProgress) => {\n if (oldProgress === 90) {\n return oldProgress;\n }\n\n if (oldProgress === 99.9) {\n // wait 1 second to close modal\n setTimeout(() => {\n setFakeProgress(100);\n }, 1000);\n\n clearInterval(interval);\n return 0;\n }\n\n return Math.min(oldProgress + 10, 100);\n });\n }, 3000);\n\n return () => clearInterval(interval);\n }\n\n return undefined;\n }, [saving]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar composições\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedCompositions.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n {fakeProgress > 0 && fakeProgress <= 100 && (\n <>\n \n Salvando composições...\n \n\n \n \n )}\n\n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedCompositions.length > 0 && (\n \n {selectedCompositions.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectComposition(item)}\n disabled={selectedCompositions.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedCompositions.some(\n (c) => c._id === item._id,\n )\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedCompositions.some(\n (c) => c._id === item._id,\n ) && (\n }\n onClick={() => handleDeleteComposition(item)}\n />\n )}\n \n ),\n active: selectedCompositions.some(\n (c) => c._id === item._id,\n ),\n })}\n data={compositions}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedCompositions.length > 0 ? (\n selectedCompositions.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhuma composição selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedCompositions((selected) =>\n selected.map((composition) =>\n composition._id === item._id\n ? {\n ...composition,\n quantity: v.floatValue,\n }\n : composition,\n ),\n );\n }}\n customInput={Input}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteComposition(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetCompositionSelect;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\nimport InputNumberFormat from 'react-number-format';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n Input,\n FormErrorMessage,\n Heading,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure } from 'types/base';\n\nexport interface FormData {\n code: string;\n type: 'separate';\n description: string;\n unit_measure_id: number;\n observation?: string;\n unit_price: number;\n labor: number;\n material: number;\n equipment: number;\n third_party: number;\n other: number;\n quantity: number;\n total_value: number;\n}\n\ninterface FormProps {\n onSubmit(data: FormData): void;\n initialData?: FormData;\n isSaving?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n initialData,\n onSubmit,\n isSaving = false,\n}) => {\n const [isLoadingFilters, setIsLoadingFilters] = useState(false);\n\n const {\n handleSubmit,\n setValue,\n control,\n register,\n clearErrors,\n setError,\n formState: { errors },\n } = useForm({\n defaultValues: {\n ...initialData,\n },\n });\n\n const [quantity, setQuantity] = useState(initialData?.quantity || 0);\n const [labor, setLabor] = useState(initialData?.labor || 0);\n const [material, setMaterial] = useState(initialData?.material || 0);\n const [equipment, setEquipment] = useState(\n initialData?.equipment || 0,\n );\n const [third_party, setThirdPartyServices] = useState(\n initialData?.third_party || 0,\n );\n const [other, setOther] = useState(initialData?.other || 0);\n\n const [unitPrice, setUnitPrice] = useState(\n initialData?.unit_price || 0,\n );\n const [totalValue, setTotalValue] = useState(\n initialData?.total_value || 0,\n );\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n initialData?.unit_measure_id || null,\n );\n\n const prepareSubmit = useCallback(\n (data) => {\n if (!unitPrice || unitPrice <= 0) {\n setError('unit_price', {\n type: 'required',\n });\n\n setError('total_value', {\n type: 'required',\n });\n\n return;\n }\n\n onSubmit({\n code: data.code,\n type: 'separate',\n description: data.description,\n unit_measure_id: data.unit_measure_id,\n unit_price: unitPrice || 0,\n labor: labor || 0,\n material: material || 0,\n equipment: equipment || 0,\n third_party: third_party || 0,\n other: other || 0,\n quantity: quantity || 0,\n total_value: totalValue || 0,\n });\n },\n [\n onSubmit,\n unitPrice,\n labor,\n material,\n equipment,\n third_party,\n other,\n quantity,\n totalValue,\n setError,\n ],\n );\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingFilters(true);\n\n try {\n const response = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded.data);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingFilters(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n useEffect(() => {\n const unitPriceTotal = labor + material + equipment + third_party + other;\n\n setUnitPrice(unitPriceTotal);\n setValue('unit_price', unitPriceTotal);\n\n if (unitPriceTotal > 0) {\n clearErrors('unit_price');\n }\n }, [labor, material, equipment, third_party, other, setValue, clearErrors]);\n\n useEffect(() => {\n const total = unitPrice * quantity;\n\n setTotalValue(total);\n setValue('total_value', total);\n\n if (total > 0) {\n clearErrors('total_value');\n }\n }, [setValue, unitPrice, quantity, clearErrors]);\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Código\n\n \n\n Código é obrigatória\n \n\n \n Descrição\n\n \n\n Descrição é obrigatória\n \n \n\n \n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isInvalid={!!errors.unit_measure_id}\n isLoading={isLoadingFilters}\n isDisabled={unitMeasuresToSelect.length === 0}\n isClearable\n onChange={(selected) => {\n const value = Number(selected?.value);\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n\n if (value) {\n clearErrors('unit_measure_id');\n } else {\n setError('unit_measure_id', {\n type: 'required',\n });\n }\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n rules={{ required: true }}\n />\n\n Unidade de medida é obrigatória\n \n\n \n Quantidade\n\n (\n {\n setQuantity(v.floatValue || 0);\n setValue('quantity', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"quantity\"\n control={control}\n rules={{ required: true }}\n />\n\n Quantidade é obrigatória\n \n \n\n \n Valores unitários (R$)\n \n\n \n \n Mão de obra\n\n (\n {\n setLabor(v.floatValue || 0);\n setValue('labor', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"labor\"\n control={control}\n />\n\n Mão de obra é obrigatória\n \n\n \n Materiais\n\n (\n {\n setMaterial(v.floatValue || 0);\n setValue('material', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"material\"\n control={control}\n />\n\n Material é obrigatório\n \n\n \n Equipamentos\n\n (\n {\n setEquipment(v.floatValue || 0);\n setValue('equipment', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"equipment\"\n control={control}\n />\n\n Equipamento é obrigatório\n \n\n \n Serviços\n\n (\n {\n setThirdPartyServices(v.floatValue || 0);\n setValue('third_party', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"third_party\"\n control={control}\n />\n\n Serviço é obrigatório\n \n\n \n Outros\n\n (\n {\n setOther(v.floatValue || 0);\n setValue('other', v.floatValue || 0);\n }}\n customInput={Input}\n />\n )}\n name=\"other\"\n control={control}\n />\n\n Outros é obrigatório\n \n \n\n \n \n Preço unitário (R$)\n\n (\n \n )}\n name=\"unit_price\"\n control={control}\n rules={{ required: true }}\n />\n\n Ao menos um valor é obrigatório\n \n\n \n Total Geral (R$)\n\n (\n \n )}\n name=\"total_value\"\n control={control}\n rules={{ required: true }}\n />\n\n \n Valor total precisa ser maior que 0\n \n \n \n\n }\n mt=\"4\"\n >\n Salvar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, { useCallback, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport Form, { FormData } from './Form';\n\ntype Component = {\n type: 'composition_custom';\n quantity: number;\n composition: Omit & {\n immobilized: boolean;\n };\n};\n\ntype ComponentData = {\n parent_stage_id: number;\n components: Component[];\n};\n\ntype CustomComposition = {\n id: number;\n budget_composition_price: {\n id: number;\n code: string;\n description: string;\n observation: string;\n immobilized: boolean;\n unit_price: number;\n unit_measure_id: {\n id: number;\n description: string;\n };\n };\n type: 'separate';\n description: string;\n unit_measure_id: number;\n observation: string;\n immobilized: boolean;\n unit_price: number;\n labor: number;\n material: number;\n labor_percent: number;\n material_percent: number;\n equipment: number;\n refund: number;\n third_party: number;\n other: number;\n quantity: number;\n code: string;\n};\n\ninterface ModalCompositionPrices extends ModalRootProps {\n data: {\n id: number;\n subStageId: number;\n budgetId: number;\n composition: CustomComposition;\n quantity: number;\n };\n}\n\nconst ModalBudgetCustomCompositionAdd: React.FC = ({\n data: { id, subStageId, budgetId, quantity, composition },\n handleClose,\n onConfirm,\n mode,\n ...restProps\n}) => {\n const [loading, setLoading] = useState(false);\n\n const getCustomComposition = useCallback(\n (original): FormData => {\n if (!composition) return {} as FormData;\n\n return {\n code: original.budget_composition_price.code,\n type: 'separate',\n description: original.budget_composition_price.description,\n unit_measure_id: original.budget_composition_price.unit_measure_id.id,\n unit_price: original.budget_composition_price.social_law_price,\n labor: original.budget_composition_price.labor,\n material: original.budget_composition_price.material,\n equipment: original.budget_composition_price.equipment,\n third_party: original.budget_composition_price.third_party_services,\n other: original.budget_composition_price.other,\n quantity,\n total_value: original.budget_composition_price.total,\n };\n },\n [quantity, composition],\n );\n\n const prepareComponents = useCallback(\n (data: FormData): ComponentData => {\n return {\n parent_stage_id: subStageId,\n components: [\n {\n type: 'composition_custom',\n quantity: data.quantity,\n composition: {\n code: data.code,\n type: 'separate',\n description: data.description,\n unit_measure_id: data.unit_measure_id,\n unit_price: data.unit_price || 0,\n labor: data.labor || 0,\n material: data.material || 0,\n equipment: data.equipment || 0,\n third_party: data.third_party || 0,\n other: data.other || 0,\n immobilized: false,\n },\n },\n ],\n };\n },\n [subStageId],\n );\n\n const prepareCustomComponent = useCallback(\n (data: FormData) => {\n return {\n id: composition.budget_composition_price.id,\n observation: composition.budget_composition_price.observation,\n labor_percent: composition.labor_percent,\n material_percent: composition.material_percent,\n type: 'separate',\n description: data.description,\n unit_measure_id: data.unit_measure_id,\n immobilized: false,\n unit_price: data.unit_price || 0,\n labor: data.labor || 0,\n material: data.material || 0,\n equipment: data.equipment || 0,\n refund: composition.refund,\n third_party: data.third_party || 0,\n other: data.other || 0,\n quantity: data.quantity,\n code: data.code,\n };\n },\n [composition],\n );\n\n const handleSubmitComponent = useCallback(\n async (data: FormData) => {\n setLoading(true);\n\n try {\n if (mode === 'add') {\n await api.post(`budget/${budgetId}/component`, {\n ...prepareComponents(data),\n });\n } else if (mode === 'edit') {\n await api.put(`budget/${budgetId}/component/${id}`, {\n type: 'composition_custom',\n component: prepareCustomComponent(data),\n });\n }\n\n toast({\n description: 'Item salvo com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm(data.quantity);\n handleClose();\n } catch (err) {\n toast({\n description:\n err?.response?.data?.message || 'Houve um erro ao salvar o item!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n },\n [\n prepareComponents,\n budgetId,\n handleClose,\n onConfirm,\n mode,\n id,\n prepareCustomComponent,\n ],\n );\n\n return (\n \n \n \n \n {mode === 'add'\n ? 'Adicionar serviço a preço informado'\n : 'Editar serviço a preço informado'}\n \n\n \n\n \n \n \n \n \n );\n};\n\nexport default ModalBudgetCustomCompositionAdd;\n","import React, { useState, useMemo, useCallback } from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { Refresh as RefreshIcon } from '@styled-icons/boxicons-regular/Refresh';\nimport { ArrowBoldDown as ArrowBoldDownIcon } from '@styled-icons/entypo/ArrowBoldDown';\nimport { ArrowBoldUp as ArrowBoldUpIcon } from '@styled-icons/entypo/ArrowBoldUp';\nimport { Warning as WarningIcon } from '@styled-icons/fluentui-system-filled/Warning';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n Text,\n Grid,\n Divider,\n RadioGroup,\n VStack,\n Radio,\n Input,\n FormErrorMessage,\n Tooltip,\n Icon,\n useMediaQuery,\n Heading,\n Flex,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport { Table, Thead, Tr, Th, Tbody, Td } from 'components/Table';\n\nimport useAlert from 'hooks/useAlert';\n\nimport { Budget } from 'types/budget';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalBudgetGlobalPriceChangeProps extends ModalRootProps {\n data: {\n budget: Budget;\n };\n}\n\ntype Mode =\n | 'coefficient'\n | 'unitary'\n | 'coefficient_labor'\n | 'unitary_tcu'\n | 'unitary_and_coefficient';\ntype Change = 'increase' | 'decrease' | 'value';\n\ntype PayloadChangeType =\n | 'coefficient'\n | 'labor_coefficient'\n | 'unit_value'\n | 'unit_value_tcu'\n | 'labor_coefficient_and_unit_value';\ntype PayloadCalculationType = 'increase' | 'discount' | 'value';\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalBudgetGlobalPriceChange: React.FC =\n ({ onConfirm, handleClose, data: { budget }, ...restProps }) => {\n const { openAlert } = useAlert();\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [mode, setMode] = useState('coefficient');\n const [change, setChange] = useState('increase');\n const [value, setValue] = useState();\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState();\n\n type Client = Budget['identification']['client'];\n const clientNameByType = (client: Client): JSX.Element => {\n if (client.type_person === 'legal') {\n return (\n <>\n {client.fantasy_name}\n
\n {client.corporate_name}\n \n );\n }\n\n return <>{client.name};\n };\n\n const changeLabel = useMemo((): string => {\n switch (change) {\n case 'increase':\n return 'Acréscimo (%)';\n case 'decrease':\n return 'Desconto (%)';\n case 'value':\n return 'Novo valor aproximado (R$)';\n default:\n return 'Alteração';\n }\n }, [change]);\n\n const changeInputsProps = useMemo(() => {\n switch (change) {\n case 'increase':\n case 'decrease':\n return {\n placeholder: '0 %',\n decimalScale: 2,\n fixedDecimalScale: true,\n thousandSeparator: '.',\n decimalSeparator: ',',\n suffix: ' %',\n };\n case 'value':\n return {\n placeholder: 'R$ 0,00',\n decimalScale: 2,\n fixedDecimalScale: true,\n thousandSeparator: '.',\n decimalSeparator: ',',\n prefix: 'R$ ',\n };\n default:\n return {};\n }\n }, [change]);\n\n const changeIcon = useMemo(() => {\n switch (change) {\n case 'increase':\n return (\n \n );\n case 'decrease':\n return (\n \n );\n case 'value':\n return (\n \n );\n default:\n return null;\n }\n }, [change]);\n\n const isAllowedToChangeValue = useMemo(() => {\n if (mode === 'coefficient_labor' || mode === 'unitary_and_coefficient') {\n return false;\n }\n\n return true;\n }, [mode]);\n\n const approximateValue = useCallback(\n (n: number, type: 'gross_total' | 'total_bdi' | 'total'): number => {\n switch (change) {\n case 'increase': {\n return n * (1 + Number(value) / 100);\n }\n case 'decrease': {\n const decreased = n * (1 - Number(value) / 100);\n return decreased < 0 ? 0 : decreased;\n }\n case 'value': {\n const difference = Number(value) / budget.total - 1; // percentual de diferença\n\n if (type === 'gross_total') {\n if (budget.total_bdi === 0) {\n return Number(value);\n }\n\n return budget.gross_total * (difference + 1);\n }\n\n if (type === 'total_bdi') {\n if (budget.total_bdi === 0) {\n return 0;\n }\n\n return budget.total_bdi * (difference + 1);\n }\n\n if (type === 'total') {\n if (budget.total_bdi === 0) {\n return Number(value);\n }\n\n return budget.total * (difference + 1);\n }\n\n return 0;\n }\n default: {\n return 0;\n }\n }\n },\n [change, value, budget],\n );\n\n const payloadChangeType = useMemo((): PayloadChangeType => {\n switch (mode) {\n case 'coefficient':\n return 'coefficient';\n case 'coefficient_labor':\n return 'labor_coefficient';\n case 'unitary':\n return 'unit_value';\n case 'unitary_tcu':\n return 'unit_value_tcu';\n case 'unitary_and_coefficient':\n return 'labor_coefficient_and_unit_value';\n default:\n return 'coefficient';\n }\n }, [mode]);\n\n const payloadCalculationType = useMemo((): PayloadCalculationType => {\n switch (change) {\n case 'increase':\n return 'increase';\n case 'decrease':\n return 'discount';\n case 'value':\n return 'value';\n default:\n return 'increase';\n }\n }, [change]);\n\n const onConfirmSubmit = useCallback(async (): Promise => {\n try {\n setLoading(true);\n\n await api.post(`/budget/${budget.id}/global/change`, {\n change_type: payloadChangeType,\n calculation_type: payloadCalculationType,\n total: value || 0,\n });\n\n if (onConfirm) onConfirm();\n\n toast({\n description: 'Solicitação de alteração realizada com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao solicitar a alteração!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [\n budget.id,\n handleClose,\n onConfirm,\n payloadCalculationType,\n payloadChangeType,\n value,\n ]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!mode) {\n toast({\n description: 'Selecione a forma de alteração!',\n status: 'warning',\n });\n\n Object.assign(formErrors, { mode: true, type: 'required' });\n }\n\n if (!change) {\n toast({\n description: 'Selecione o tipo de alteração!',\n status: 'warning',\n });\n\n Object.assign(formErrors, { change: true, type: 'required' });\n }\n\n if (!value) {\n Object.assign(formErrors, { value: true, type: 'required' });\n }\n\n if (change === 'decrease' && value && value >= 100) {\n toast({\n description: `O valor de desconto não pode ser maior que 100%! O ajuste não pode resultar em valores negativos ou zerados.`,\n status: 'warning',\n });\n\n Object.assign(formErrors, { value: true, type: 'invalid' });\n }\n\n if (change === 'value' && value && value <= 0) {\n toast({\n description: `O valor deve ser maior que zero! O ajuste não pode resultar em valores negativos ou zerados.`,\n status: 'warning',\n });\n\n Object.assign(formErrors, { value: true, type: 'invalid' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n openAlert({\n type: 'info',\n size: '3xl',\n title: 'Confirmação de alteração global',\n description: () => (\n \n \n Você está prestes a alterar os valores do orçamento com base nos\n novos parâmetros definidos. Abaixo, confira a prévia do novo custo\n total recalculado:\n \n\n \n Esses valores são aproximados e podem sofrer variações devido a\n arredondamentos e cálculos internos do sistema.\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
DescriçãoValor Atual (R$)\n Novo valor (R$)\n {change === 'value' ? ' ' : ` - ${Number(value)}% `}{' '}\n {changeIcon}\n
\n Custo sem BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.gross_total || 0)}\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(\n approximateValue(budget.gross_total, 'gross_total'),\n )}\n
\n Custo do BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total_bdi || 0)}\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(approximateValue(budget.total_bdi, 'total_bdi'))}\n
\n Custo total do orçamento\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total)}\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(approximateValue(budget.total, 'total'))}\n
\n\n \n \n \n Após a confirmação, não será possível restaurar os preços atuais\n automáticamente. Caso precise reverter as alterações, será\n necessário ajustar os valores manualmente.\n \n
\n \n ),\n buttons: ['Cancelar', 'Confirmar'],\n onConfirm: onConfirmSubmit,\n });\n };\n\n return (\n \n \n \n Alterar valor global do orçamento\n\n \n\n \n \n Ao realizar essa ação, todo o orçamento será alterado de acordo\n com os dados atuais, incluindo edições já realizadas. Se a\n alteração for por coeficiente, ela refletirá apenas na estrutura\n das composições (primeiro nível de mapeamento)\n \n\n \n \n \n Para que a alteração global funcione corretamente, todas as\n bases devem ter a mesma referência. Misturas de bases diferentes\n ou bases próprias com outras bases podem gerar inconsistências.\n Certifique-se de que todas as referências são iguais.\n \n \n\n \n\n \n \n Descrição do orçamento\n \n {budget.identification?.description || 'Não especificada'}\n \n \n\n {budget.identification?.client && (\n \n Cliente\n \n {clientNameByType(budget.identification.client)}\n \n \n )}\n \n \n \n Total sem BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.gross_total || 0)}\n \n \n\n \n Total do BDI\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total_bdi || 0)}{' '}\n (\n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 2,\n }).format(budget.bdi_percent || 0)}\n %)\n \n \n\n \n Total Geral\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total || 0)}\n \n \n \n\n \n\n \n \n Forma de alteração\n {\n setMode(v as Mode);\n if (\n v === 'coefficient_labor' ||\n v === 'unitary_and_coefficient'\n ) {\n setChange('increase');\n }\n }}\n >\n \n \n Alterar coeficiente{' '}\n \n \n \n \n\n \n Alterar valor unitário{' '}\n \n \n \n \n\n \n Alterar coeficiente - mão de obra{' '}\n \n \n \n \n\n \n Alterar valor unitário - Acórdão 938/2014 TCU{' '}\n \n \n \n \n\n \n Alterar valor e coeficiente{' '}\n \n \n \n \n \n \n \n\n \n Alteração do valor\n setChange(v as Change)}\n >\n \n Acréscimo (%)\n Desconto (%)\n \n Novo valor aproximado (R$){' '}\n \n \n \n \n\n \n {changeLabel}\n {\n if (v.floatValue) {\n setErrors((prev) => {\n if (prev?.value) {\n return { ...prev, value: false };\n }\n\n return prev;\n });\n }\n\n setValue(v.floatValue || 0);\n }}\n customInput={Input}\n />\n\n \n {!value && errors?.value === true\n ? 'Valor é obrigatório'\n : 'Valor inválido'}\n \n \n \n \n\n \n \n Salvar\n \n \n \n \n );\n };\n\nexport default ModalBudgetGlobalPriceChange;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\ntype Props = {\n description: string;\n color: string;\n};\n\nconst FlowStatusBadge: React.FC = ({ color, description }: Props) => {\n return (\n \n {description || 'Não definido'}\n \n );\n};\n\nexport default FlowStatusBadge;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Text,\n Grid,\n HStack,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { User } from 'types/access-control';\nimport { Budget } from 'types/budget';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport FlowStatusBadge from './StatusBadge';\n\ninterface ModalManageFlowProps extends ModalRootProps {\n data: {\n budget: Budget;\n };\n}\n\ntype FlowHistory = {\n id: number;\n type: string;\n user: {\n id: number;\n name: string;\n email: string;\n profile_verified: true;\n corporate_name: null;\n fantasy_name: null;\n document_type: null;\n document: null;\n address: null;\n number: null;\n complement: null;\n district: null;\n zip_code: null;\n city: null;\n created_at: string;\n updated_at: string;\n deleted_at: null;\n };\n object: {\n status: {\n color: string;\n icon: string;\n name: string;\n };\n };\n status: {\n color: string;\n icon: string;\n name: string;\n };\n message: string;\n created_at: string;\n updated_at: string;\n};\n\ntype FlowUser = FlowHistory['user'];\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalManageFlow: React.FC = ({\n handleClose,\n data: budgetData,\n ...restProps\n}) => {\n const { budget } = budgetData;\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get('/flow/history', {\n params: {\n 'filter[object_id]': budget.id,\n 'filter[object_type]': 'budget',\n page: pagination.page,\n per_page: pagination.per_page,\n sort: '-created_at',\n },\n });\n\n const history = response.data;\n\n const newPagination = {\n last_page: history.meta.last_page,\n };\n\n setData(history.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [pagination, budget]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleConfirm = (): void => {\n handleClose();\n };\n\n const getBudgetUserName = (item: User): string => {\n if (item.document_type === 'cnpj') {\n return `${item.corporate_name} - ${item.fantasy_name}`;\n }\n\n return item.name;\n };\n\n const getUserName = (item: FlowUser): string => {\n if (item.document_type === 'cnpj') {\n return `${item.corporate_name} - ${item.fantasy_name}`;\n }\n\n return item.name;\n };\n\n return (\n \n \n \n Histórico de aprovação\n\n \n\n \n \n \n Descrição: \n \n {budget.identification.description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Criação: \n \n {formatDate(budget.created_at)}\n \n \n\n {!!budget.user && (\n <>\n \n Usuário: \n {getBudgetUserName(budget.user)}\n \n \n )}\n\n \n Total: \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total)}{' '}\n {`(${Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 2,\n }).format(\n budget.total_separate_percent || 0,\n )}% complementares)`}\n \n \n \n\n ({\n id: item.id,\n responsible: (\n <>\n {formatDate(item.created_at)}\n\n \n {getUserName(item.user)}\n \n \n ),\n status: (\n \n ),\n message: {item.message},\n actions: null,\n })}\n data={data}\n noDataMessage=\"Nenhuma ação registrada.\"\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n Fechar\n \n \n \n \n \n );\n};\n\nexport default ModalManageFlow;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n IconButton,\n Input as ChakraInput,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport { Input, State, DefaultPrice, StatePrice } from 'types/input';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalInputSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n budgetId: number;\n compositionId: number;\n };\n}\n\ntype Fragment = {\n input_id: number;\n coefficient: number;\n type: 'typed' | 'common';\n price_type_id: number;\n locale_key: string;\n};\n\ntype ComponentData = {\n fragments: Fragment[];\n};\n\ntype SelectedInput = Input & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetInputFragmentSelect: React.FC = ({\n data: { budgetId, bases, compositionId },\n handleClose,\n onConfirm,\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [inputs, setInputs] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedInputs, setSelectedInputs] = useState([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (input: Input): number => {\n const price = getStatePrice(input);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setInputs([]);\n\n try {\n const response = await api.get('/input', {\n params: {\n 'filter[resource]': 'input',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const inputsData = response.data;\n\n const newPagination = {\n last_page: inputsData.meta\n ? inputsData.meta.last_page\n : inputsData.last_page,\n };\n\n setInputs(inputsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message || 'Houve um erro ao buscar os insumos.',\n });\n\n setInputs([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectInput = (item: Input): void => {\n setSelectedInputs((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteInput = (item: Input): void => {\n setSelectedInputs((selected) => selected.filter((c) => c._id !== item._id));\n };\n\n const getStatePrice = (item: Input): State => {\n if (!item._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(item._source.prices));\n const state = states[0];\n\n return item._source.prices[state];\n };\n\n const getStateKey = (input: Input): string => {\n if (!input._source.prices) {\n return '';\n }\n\n const states = Array.from(Object.keys(input._source.prices));\n const state = states[0];\n\n return state;\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedInput[]): ComponentData => {\n if (!searchFilter.price_type_id) {\n return { fragments: [] };\n }\n\n return {\n fragments: selected.map((item) => ({\n input_id: Number(item._id),\n coefficient: item.quantity || 1,\n type: 'typed',\n price_type_id: Number(searchFilter.price_type_id),\n locale_key: getStateKey(item),\n })),\n };\n },\n [searchFilter.price_type_id],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.post(\n `budget/${budgetId}/composition/${compositionId}/component/fragment`,\n {\n ...prepareComponents(selectedInputs),\n },\n );\n\n toast({\n description: 'Insumos salvos com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar os insumos selecionados.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedInputs,\n prepareComponents,\n budgetId,\n handleClose,\n onConfirm,\n compositionId,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar insumos\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedInputs.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedInputs.length > 0 && (\n \n {selectedInputs.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectInput(item)}\n disabled={selectedInputs.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedInputs.some((c) => c._id === item._id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedInputs.some((c) => c._id === item._id) && (\n }\n onClick={() => handleDeleteInput(item)}\n />\n )}\n \n ),\n active: selectedInputs.some((c) => c._id === item._id),\n })}\n data={inputs}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedInputs.length > 0 ? (\n selectedInputs.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhum insumo selecionado\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedInputs((selected) =>\n selected.map((input) =>\n input._id === item._id\n ? {\n ...input,\n quantity: v.floatValue,\n }\n : input,\n ),\n );\n }}\n customInput={ChakraInput}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteInput(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetInputFragmentSelect;\n","import React, { useCallback, useMemo, useState, useEffect } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport { UnitMeasure } from 'types/base';\nimport { Budget } from 'types/budget';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n bases: Budget['bases'];\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst SearchFilter: React.FC = ({\n bases: budgetBases,\n onSubmit,\n loading = false,\n}) => {\n const {\n handleSubmit,\n setValue,\n register,\n control,\n formState: { errors },\n } = useForm();\n\n const [selectedBase, setSelectedBase] = useState(null);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const basesToSelect = useMemo(() => {\n return budgetBases.map((base) => ({\n value: String(base.version.base.id),\n label: base.version.base.description,\n }));\n }, [budgetBases]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = useCallback(\n (selected: Selected): void => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBase(value);\n setValue('base_id', value);\n\n const baseSelected = budgetBases.find(\n (base) => base.version.base.id === value,\n );\n\n if (baseSelected) {\n setSelectedBaseVersion(baseSelected.version.id);\n setValue('version_id', baseSelected.version.id);\n\n setSelectedBaseLocale(baseSelected.locale.id);\n setValue('locale_id', baseSelected.locale.id);\n\n setSelectedBasePriceType(baseSelected.price_type.id);\n setValue('price_type_id', baseSelected.price_type.id);\n }\n },\n [budgetBases, setValue],\n );\n\n useEffect(() => {\n const { base } = budgetBases[0].version;\n\n if (base) {\n handleBaseChange({ value: String(base.id) });\n }\n }, [budgetBases, handleBaseChange]);\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n const versionDescription = budgetBases.find(\n (base) => base.version.id === selectedBaseVersion,\n )?.version.description;\n\n const localeDescription = budgetBases.find(\n (base) => base.locale.id === selectedBaseLocale,\n )?.locale.description;\n\n const priceTypeDescription = budgetBases.find(\n (base) => base.price_type.id === selectedBasePriceType,\n )?.price_type.description;\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isDisabled={basesToSelect.length === 0}\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n \n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n \n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n \n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useState,\n useMemo,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Input as ChakraInput,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n IconButton,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Budget } from 'types/budget';\nimport { Input, State, DefaultPrice, StatePrice } from 'types/input';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ninterface ModalInputSelect extends ModalRootProps {\n data: {\n bases: Budget['bases'];\n subStageId: number;\n budgetId: number;\n };\n}\n\ntype Component = {\n type: 'input_original';\n quantity: number;\n input_id: number;\n budget_base_id: number;\n};\n\ntype ComponentData = {\n parent_stage_id: number;\n components: Component[];\n};\n\ntype SelectedInput = Input & {\n quantity: number | undefined;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\nconst ModalBudgetInputSelect: React.FC = ({\n data: { budgetId, bases, subStageId },\n handleClose,\n onConfirm,\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [inputs, setInputs] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.price_type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.price_type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedInputs, setSelectedInputs] = useState([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.price_type_id) {\n Object.assign(validFilter, {\n 'filter[price_type_id]': filter.price_type_id,\n });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (input: Input): number => {\n const price = getStatePrice(input);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback(\n (sortString: string | null): Record => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n },\n [],\n );\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setInputs([]);\n\n try {\n const response = await api.get('/input', {\n params: {\n 'filter[resource]': 'input',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const inputsData = response.data;\n\n const newPagination = {\n last_page: inputsData.meta\n ? inputsData.meta.last_page\n : inputsData.last_page,\n };\n\n setInputs(inputsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message || 'Houve um erro ao buscar os insumos.',\n });\n\n setInputs([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectInput = (item: Input): void => {\n setSelectedInputs((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n },\n ]);\n };\n\n const handleDeleteInput = (item: Input): void => {\n setSelectedInputs((selected) => selected.filter((c) => c._id !== item._id));\n };\n\n const getStatePrice = (item: Input): State => {\n if (!item._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(item._source.prices));\n const state = states[0];\n\n return item._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedInput[]): ComponentData => {\n return {\n parent_stage_id: subStageId,\n components: selected.map((item) => ({\n type: 'input_original',\n input_id: Number(item._id),\n quantity: item.quantity || 0,\n budget_base_id:\n bases.find(\n (b) => b.version.base.id === item._source.version.base.id,\n )?.id || 0,\n })),\n };\n },\n [subStageId, bases],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n await api.post(`budget/${budgetId}/component`, {\n ...prepareComponents(selectedInputs),\n });\n\n toast({\n description: 'Insumos salvos com sucesso!',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar os insumos selecionados.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [selectedInputs, prepareComponents, budgetId, handleClose, onConfirm]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar insumos\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedInputs.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedInputs.length > 0 && (\n \n {selectedInputs.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(data)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectInput(item)}\n disabled={selectedInputs.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedInputs.some((c) => c._id === item._id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedInputs.some((c) => c._id === item._id) && (\n }\n onClick={() => handleDeleteInput(item)}\n />\n )}\n \n ),\n active: selectedInputs.some((c) => c._id === item._id),\n })}\n data={inputs}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedInputs.length > 0 ? (\n selectedInputs.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhum insumo selecionado\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedInputs((selected) =>\n selected.map((input) =>\n input._id === item._id\n ? {\n ...input,\n quantity: v.floatValue,\n }\n : input,\n ),\n );\n }}\n customInput={ChakraInput}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteInput(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetInputSelect;\n","import React from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Warning as WarningIcon } from '@styled-icons/entypo/Warning';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport MdiGroupIcon from 'mdi-react/GroupIcon';\n\nimport {\n Box,\n Icon,\n Tr,\n Td,\n Text,\n Flex,\n Tooltip,\n HStack,\n Button,\n IconButton,\n} from '@chakra-ui/react';\n\nimport { Row, FlattenedComponent } from './types';\n\nexport type Composition = {\n price: number;\n unit_price_was_changed: boolean;\n unit_price_original: number;\n newQuantity: number;\n recursive_quantity: number;\n outdated_price: boolean;\n composition_price: {\n base: {\n description: string;\n };\n version: {\n description: string;\n };\n composition: {\n code: string;\n description: string;\n version: {\n year?: number;\n month?: number;\n description: string;\n base: {\n description: string;\n };\n };\n unit_measure: {\n description: string;\n };\n };\n };\n};\n\ninterface RowProps {\n row: Row & { original: FlattenedComponent & Composition };\n activeTab: 'list' | 'selected';\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n}\n\nconst CompositionRow: React.FC = ({\n row,\n activeTab,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n}) => {\n return (\n \n \n \n {row.original.location} \n \n \n\n \n \n {row.original.composition_price.base?.description}\n \n\n \n {row.original.composition_price.version?.description}\n \n \n\n {row.original.composition_price.composition.code}\n\n \n \n {row.original.composition_price.composition.description}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 4,\n }).format(row.original.quantity)}\n \n\n \n \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.social_law_price)}\n \n\n {row.original.outdated_price && (\n \n \n \n )}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.price)}\n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.total)}\n \n\n \n {activeTab === 'list' ? (\n \n }\n onClick={() => handleSelectComponent(row.original)}\n disabled={selectedComponents.some(\n (c) => c.id === row.original.id,\n )}\n >\n {selectedComponents.some((c) => c.id === row.original.id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedComponents.some((c) => c.id === row.original.id) && (\n }\n onClick={() => handleDeleteComponent(row.original)}\n />\n )}\n \n ) : (\n }\n onClick={() => handleDeleteComponent(row.original)}\n >\n Remover\n \n )}\n \n \n );\n};\n\nexport default CompositionRow;\n","import React from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Warning as WarningIcon } from '@styled-icons/entypo/Warning';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\n\nimport {\n Box,\n Icon,\n Td,\n Text,\n Input,\n Flex,\n Tooltip,\n Tr,\n HStack,\n Button,\n IconButton,\n} from '@chakra-ui/react';\n\nimport { Row, FlattenedComponent } from './types';\n\nexport type Input = {\n price: number;\n newQuantity: number;\n recursive_quantity: number;\n input_price: {\n base: {\n description: string;\n };\n version: {\n description: string;\n };\n input: {\n code: string;\n description: string;\n version: {\n year?: number;\n month?: number;\n description: string;\n base: {\n description: string;\n };\n };\n unit_measure: {\n description: string;\n };\n };\n };\n};\n\ninterface RowProps {\n row: Row & { original: FlattenedComponent & Input };\n activeTab: 'list' | 'selected';\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n}\n\nconst InputRow: React.FC = ({\n row,\n selectedComponents,\n activeTab,\n handleSelectComponent,\n handleDeleteComponent,\n}) => {\n return (\n \n \n \n {row.original.location} \n \n \n\n \n \n {row.original.input_price.base?.description}{' '}\n \n\n \n {row.original.input_price.version?.description ||\n row.original.input_price.input?.version?.description}\n \n \n\n {row.original.input_price.input.code}\n \n \n {row.original.input_price.input.description}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 4,\n }).format(row.original.quantity)}\n \n\n \n \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.social_law_price)}\n \n\n {row.original.outdated_price && (\n \n \n \n )}\n \n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.price)}\n \n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(row.original.total)}\n \n\n \n {activeTab === 'list' ? (\n \n }\n onClick={() => handleSelectComponent(row.original)}\n disabled={selectedComponents.some(\n (c) => c.id === row.original.id,\n )}\n >\n {selectedComponents.some((c) => c.id === row.original.id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedComponents.some((c) => c.id === row.original.id) && (\n }\n onClick={() => handleDeleteComponent(row.original)}\n />\n )}\n \n ) : (\n }\n onClick={() => handleDeleteComponent(row.original)}\n >\n Remover\n \n )}\n \n \n );\n};\n\nexport default InputRow;\n","import React, { useCallback } from 'react';\nimport {\n TableBodyPropGetter,\n TableBodyProps,\n Row,\n ColumnInstance,\n} from 'react-table';\n\nimport { Tbody, Tr } from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport { Td } from 'components/Table';\n\nimport CompositionRow from './CompositionRow';\nimport InputRow from './InputRow';\nimport { FlattenedComponent, Stage } from './types';\n\ntype RowType = Stage['type'];\n\ninterface OutdatedComponentsBodyProps {\n getTableBodyProps: (\n propGetter?: TableBodyPropGetter | undefined,\n ) => TableBodyProps;\n loading: boolean;\n data: FlattenedComponent[];\n rows: Row[];\n\n visibleColumns: ColumnInstance[];\n prepareRow: (row: Row) => void;\n\n activeTab: 'list' | 'selected';\n\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n}\n\nconst OutdatedComponentsBody: React.FC = ({\n getTableBodyProps,\n loading,\n data,\n rows,\n prepareRow,\n activeTab,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n}) => {\n const getRow = useCallback(\n (type: RowType, row: Row) => {\n if (type === 'composition_original') {\n return (\n \n );\n }\n\n if (type === 'input_original') {\n return (\n \n );\n }\n\n return null;\n },\n [\n activeTab,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n ],\n );\n\n return (\n \n {(!loading || data.length >= 0) &&\n rows.map((row) => {\n prepareRow(row);\n return getRow(row.original.type, row);\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && data.length === 0 && (\n \n \n {activeTab === 'list'\n ? 'Nenhum componente desatualizado encontrado'\n : 'Nenhum componente selecionado'}\n \n \n )}\n \n );\n};\n\nexport default OutdatedComponentsBody;\n","import React, { useMemo, useCallback } from 'react';\nimport { useTable } from 'react-table';\n\nimport {\n TableContainer,\n Table,\n Thead,\n Tr,\n Th,\n Text,\n Box,\n Flex,\n Checkbox,\n} from '@chakra-ui/react';\n\nimport OutdatedComponentsTableBody from './OutdatedComponentsTableBody';\nimport { Row, FlattenedComponent } from './types';\n\ninterface OutdatedComponentsTableProps {\n data: FlattenedComponent[];\n loading: boolean;\n activeTab: 'list' | 'selected';\n selectedComponents: FlattenedComponent[];\n handleSelectComponent: (component: FlattenedComponent) => void;\n handleDeleteComponent: (component: FlattenedComponent) => void;\n toggleSelectAllComponents: () => void;\n}\n\nconst OutdatedComponentsTable: React.FC = ({\n data,\n loading,\n activeTab,\n selectedComponents,\n handleSelectComponent,\n handleDeleteComponent,\n toggleSelectAllComponents,\n}) => {\n const columns = useMemo(\n () => [\n {\n Header: 'Item',\n key: 'item',\n width: '5%',\n isCentered: true,\n },\n {\n Header: 'Base',\n width: '10%',\n key: 'base',\n isCentered: true,\n },\n {\n Header: 'Código',\n width: '5%',\n key: 'code',\n },\n\n {\n Header: 'Descrição',\n width: '50%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {`${row.original.location} -`}\n {row.original.title}\n \n );\n },\n },\n {\n Header: 'Qtde',\n width: '1%',\n colSpan: 10,\n isNumeric: true,\n key: 'quantity',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.quantity;\n\n return Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 7,\n }).format(value || 0);\n },\n },\n {\n Header: 'Unit.',\n width: '1%',\n isNumeric: true,\n key: 'unitary_value',\n },\n {\n Header: 'Com BDI',\n width: '1%',\n key: 'with_bdi',\n isNumeric: true,\n },\n {\n id: 'total',\n Header: 'Total',\n width: '1%',\n isNumeric: true,\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: (\n \n {activeTab === 'list' && (\n 0 && selectedComponents.length === data.length\n }\n title=\"Selecionar todos\"\n />\n )}\n \n Ações\n \n \n ),\n id: 'actions',\n width: '5%',\n Cell: () => {\n return <>;\n },\n },\n ],\n [data, activeTab, selectedComponents, toggleSelectAllComponents],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable({\n columns,\n data,\n getRowId,\n });\n\n return (\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n
\n
\n );\n};\n\nexport default OutdatedComponentsTable;\n","import React, { Suspense, useCallback, useEffect, useState } from 'react';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Box,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport OutdatedComponentsTable from './OutdatedComponentsTable';\nimport { FlattenedComponent } from './types';\n\ninterface ModalOutdatedComponentSelect extends ModalRootProps {\n data: {\n budgetId: number;\n };\n}\n\ntype SelectedComponent = FlattenedComponent;\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalBudgetOutdatedComponentSelect: React.FC =\n ({ data: { budgetId }, handleClose, onConfirm, ...restProps }) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [saving, setSaving] = useState(false);\n\n const [components, setComponents] = useState([]);\n const [selectedComponents, setSelectedComponents] = useState<\n SelectedComponent[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const getData = useCallback(async () => {\n setLoading(true);\n setComponents([]);\n\n try {\n const { data: response } = await api.get(\n `/budget/${budgetId}/component`,\n {\n params: {\n 'filter[outdated_price]': 1,\n sort: 'position',\n },\n },\n );\n\n const componentsData = response.data;\n\n setComponents(componentsData);\n } catch (err) {\n toast({\n status: 'error',\n description:\n err.response?.data?.message ||\n 'Houve um erro ao buscar composições',\n });\n\n setComponents([]);\n } finally {\n setLoading(false);\n }\n }, [budgetId]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComponent = (item: FlattenedComponent): void => {\n setSelectedComponents((prepared) => [\n ...prepared,\n {\n ...item,\n },\n ]);\n };\n\n const handleDeleteComponent = (item: FlattenedComponent): void => {\n setSelectedComponents((selected) =>\n selected.filter((c) => c.id !== item.id),\n );\n };\n\n const toggleSelectAllComponents = (): void => {\n if (selectedComponents.length === components.length) {\n setSelectedComponents([]);\n } else {\n setSelectedComponents(components);\n }\n };\n\n const handleSubmitComponents = useCallback(async () => {\n setSaving(true);\n\n try {\n await api.post(`budget/${budgetId}/restore/prices`, {\n budget_components: selectedComponents.map(\n (component) => component.id,\n ),\n });\n\n toast({\n description:\n 'Solicitação de atualização enviada com sucesso. Você será notificado quando a atualização for concluída.',\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao enviar a solicitação de atualização',\n status: 'error',\n });\n }\n } finally {\n setSaving(false);\n }\n }, [handleClose, onConfirm, selectedComponents, budgetId]);\n\n return (\n \n \n \n Selecionar componentes para atualização\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isLoading={loading}\n isDisabled={\n (activeTab === 1 && selectedComponents.length === 0) || loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n \n Componentes desatualizados\n \n \n Selecionados{' '}\n {selectedComponents.length > 0 && (\n \n {selectedComponents.length}\n \n )}\n \n \n\n }>\n \n \n \n \n\n \n \n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n \n \n \n \n \n \n \n );\n };\n\nexport default ModalBudgetOutdatedComponentSelect;\n","import React, { useState, useEffect, useCallback, useContext } from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n SimpleGrid,\n HStack,\n Flex,\n Input,\n Select,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport useDebouncedState from 'hooks/useDebouncedState';\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Client } from 'types/client';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nconst ModalClientLookup: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n\n const [clientList, setClientList] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [keyword, setKeyword] = useDebouncedState('');\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 10,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getClientList = useCallback(async () => {\n setLoading(true);\n setClientList([]);\n\n try {\n const response = await api.get('/client', {\n params: {\n 'filter[keyword]': keyword,\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[organization_id]': user.managed_organization.organization.id,\n },\n });\n\n const clients = response.data;\n\n const newPagination = {\n last_page: clients.meta.last_page,\n };\n\n setClientList(clients.data);\n setServicePagination(newPagination);\n } catch (err) {\n setClientList([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [keyword, pagination, user]);\n\n useEffect(() => {\n getClientList();\n }, [getClientList]);\n\n const clientNameByType = (client: Client): React.ReactNode => {\n if (client.type_person === 'legal') {\n return (\n <>\n {client.fantasy_name}\n
\n {client.corporate_name}\n \n );\n }\n\n return client.name;\n };\n\n const handleConfirm = (client: Client): void => {\n if (onConfirm) onConfirm(client);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar cliente\n\n \n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n setKeyword(e.target.value)}\n mb={{ base: 3, md: 0 }}\n />\n \n \n\n ({\n id: item.id,\n name: (\n <>\n {clientNameByType(item)}\n \n {item.document}\n \n \n ),\n phone: (\n <>\n {item.phone}\n
\n {item.cell_phone}\n \n ),\n email: item.email,\n contact: item.contact,\n actions: (\n }\n onClick={() => handleConfirm(item)}\n >\n Selecionar\n \n ),\n })}\n data={clientList}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n
\n
\n
\n );\n};\n\nexport default ModalClientLookup;\n","import React from 'react';\n\nimport {\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Input,\n Select,\n Textarea,\n} from '@chakra-ui/react';\n\nimport { PreparedClient } from 'types/client';\n\ninterface FormProps {\n initialData?: PreparedClient;\n}\n\nconst FormClientLookup: React.FC = ({ initialData }) => {\n return (\n *': {\n marginY: 1,\n },\n }}\n >\n \n \n Tipo\n\n \n \n\n \n \n {initialData?.type_person === 'legal' ? 'CNPJ' : 'CPF'}\n \n\n \n \n \n\n {initialData?.type_person === 'physical' && (\n \n Nome completo\n\n \n \n )}\n\n {initialData?.type_person === 'legal' && (\n \n \n Razão Social\n\n \n \n\n \n Nome fantasia\n\n \n \n \n )}\n\n \n \n Telefone (fixo)\n \n \n\n \n Telefone (celular / WhatsApp)\n\n \n \n \n\n \n \n Email\n\n \n \n\n \n Contato\n\n \n \n \n\n \n \n CEP\n \n \n\n \n Estado\n\n \n \n\n \n Cidade\n\n \n \n \n\n \n \n Endereço\n\n \n \n\n \n Número\n\n \n \n\n \n Complemento\n\n \n \n\n \n Bairro\n \n \n \n\n \n Observação\n \n \n \n );\n};\n\nexport default FormClientLookup;\n","import React, { useState, useCallback, useEffect } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport { ServiceClient, PreparedClient } from 'types/client';\n\nimport Form from './Form';\n\ntype Props = ModalRootProps & {\n data?: {\n client_id?: number;\n };\n};\n\nconst ModalClientLookup: React.FC = ({ data, ...rest }) => {\n const [client, setClient] = useState({} as ServiceClient);\n\n const getClient = useCallback(async (): Promise => {\n try {\n if (data?.client_id) {\n const response = await api.get(`/client/${data.client_id}`);\n\n const clientLoaded = response.data;\n\n setClient({\n ...clientLoaded.data,\n });\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar carregar o cliente',\n status: 'error',\n });\n }\n }, [setClient, data]);\n\n useEffect(() => {\n getClient();\n }, [getClient]);\n\n const prepareClient = (value: ServiceClient): PreparedClient => ({\n ...value,\n type_person: value.type_person || 'physical',\n document: value.document,\n cep: value.zip_code || '',\n state_name: value.city_id?.state.name,\n city_name: value.city_id?.name,\n });\n\n return (\n \n \n \n Visualizar cliente\n\n \n\n \n
\n \n \n \n );\n};\n\nexport default ModalClientLookup;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { FragmentResource, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n nextComponentId: number;\n nextComponentPriceTypeKey: string;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst FragmentTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original.fragment_type;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n nextComponentId: row.original.fragment.id,\n nextComponentPriceTypeKey: row.original.price_type?.key,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default FragmentTableRow;\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Icon,\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Flex,\n Box,\n Skeleton,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport FragmentTableRow from './FragmentsTableRow';\nimport { FragmentResource, Row } from './types';\n\nexport type FragmentSummary = {\n total: number;\n material: number;\n material_percent: number;\n equipment: number;\n equipment_percent: number;\n labor: number;\n labor_percent: number;\n third_party: number;\n third_party_percent: number;\n other: number;\n other_percent: number;\n};\n\ntype QttySummary = {\n total_compositions: number;\n total_inputs: number;\n};\n\ntype Props = {\n component_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n isSubRow?: boolean;\n parentFragments?: FragmentResource[];\n parentQttySummary?: QttySummary;\n};\n\nconst FragmentsTable: React.FC = ({\n isSubRow = false,\n parentFragments = [],\n component_id,\n locale_key,\n price_type_id,\n price_type_key,\n}) => {\n const [fragments, setFragments] = useState([]);\n const [qttySummary, setQttySummary] = useState(\n {} as QttySummary,\n );\n const [loading, setLoading] = useState(false);\n\n const getData = useCallback(async () => {\n setLoading(true);\n setFragments([]);\n\n try {\n const response = await api.get(\n `/composition/${component_id}/component/fragment`,\n {\n params: {\n page: 1,\n per_page: 999,\n 'filter[locale_key]': locale_key,\n 'filter[price_type_key]': price_type_key,\n },\n },\n );\n\n const fragmentsLoaded = response.data;\n\n const newQttySummary = {\n total_compositions: fragmentsLoaded.summary.total.total_compositions,\n total_inputs: fragmentsLoaded.summary.total.total_inputs,\n };\n\n setFragments(fragmentsLoaded.data);\n setQttySummary(newQttySummary);\n } catch (err) {\n setFragments([]);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar o mapeamento da composição.',\n status: 'error',\n });\n setQttySummary({} as QttySummary);\n } finally {\n setLoading(false);\n }\n }, [component_id, locale_key, price_type_key]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const isInput = (data: FragmentResource): boolean => {\n return data.fragment_type.includes('input');\n };\n\n const getType = (row: Row): string => {\n return row.original.fragment_type;\n };\n\n const getIcon = (row: Row): MdiReactIconComponentType => {\n if (getType(row).includes('input')) {\n return InfoIcon;\n }\n\n return GroupIcon;\n };\n\n const shouldShowInputIcon = (i: FragmentResource): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i.fragment.classification.key);\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: FragmentResource): InputIcon => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputIconType = useCallback((i: FragmentResource): string => {\n const value = i.fragment?.classification?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const columns = useMemo(\n () => [\n {\n Header: () => 'Tipo',\n id: 'expander',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n \n \n \n\n {isInput(row.original) && shouldShowInputIcon(row.original) && (\n \n \n \n )}\n\n {getType(row).includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n \n );\n },\n },\n {\n Header: 'Código',\n accessor: 'data.code',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return `${row.original.fragment.code} / ${row.original.fragment.version.base.description}`;\n },\n },\n {\n Header: 'Descrição',\n accessor: 'data.description',\n width: '70%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original.fragment.description}\n \n );\n },\n },\n {\n Header: 'Unidade',\n accessor: 'data.unit_measure_id',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.fragment.unit_measure.description;\n },\n },\n {\n Header: 'Coeficiente',\n accessor: 'data.coefficient',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return row.original.coefficient;\n },\n },\n {\n Header: 'Valor unitário',\n accessor: 'data.unit_value',\n isNumeric: true,\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.unit_price;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n {\n Header: 'Total',\n accessor: 'data.total',\n isNumeric: true,\n width: '15%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original.total;\n\n return Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value || 0);\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getInputIcon],\n );\n\n const getRowId = useCallback((row) => {\n return row.id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n // @ts-expect-error types\n columns,\n data: fragments,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ nextComponentId, nextComponentPriceTypeKey }) => (\n \n ),\n [locale_key, price_type_id, fragments],\n );\n\n const parent = useMemo(() => {\n return parentFragments.find((f) => f.fragment.id === component_id);\n }, [parentFragments, component_id]);\n\n return (\n <>\n {isSubRow && (\n \n <>\n \n Classe\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.classification.description || '-'}\n )}\n \n \n\n \n Tipo\n \n {loading ? (\n \n ) : (\n <>{parent?.fragment.type.description || '-'}\n )}\n \n \n\n \n Composições\n \n {loading ? (\n \n ) : (\n <>{qttySummary.total_compositions}\n )}\n \n \n\n \n Insumos\n \n {loading ? (\n \n ) : (\n <> {qttySummary.total_inputs}\n )}\n \n \n \n \n )}\n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && fragments.length === 0 && (\n \n \n Nenhum resultado encontrado.\n \n \n )}\n \n
\n
\n \n );\n};\n\nexport default FragmentsTable;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { DollarSign as DollarSignIcon } from '@styled-icons/fa-solid/DollarSign';\nimport { api } from 'services/api';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Flex,\n Text,\n Box,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport SummaryContainer from 'components/SummaryContainer';\nimport SummaryDataChartCard from 'components/SummaryDataChartCard';\n\nimport FragmentsTable, { FragmentSummary } from './FragmentsTable';\n\ntype Props = ModalRootProps & {\n data: {\n id: number;\n locale_id: number;\n locale_key: string;\n price_type_id: number;\n price_type_key: string;\n code: string;\n base: string;\n description: string;\n prices: string;\n price: number;\n classification: string;\n type: string;\n unit_measure: string;\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalCompositionLookup: React.FC = ({ data, ...restProps }) => {\n const [loading, setLoading] = useState(false);\n const [summary, setSummary] = useState(\n {} as FragmentSummary,\n );\n\n const price: number = (() => {\n const prices = JSON.parse(data.prices);\n\n if (prices.length === 0) {\n return data.price || 0;\n }\n\n const states = Array.from(Object.keys(prices));\n const state = states[0];\n\n const price_ = prices[state];\n\n if (price_.default) {\n return price_.default.total;\n }\n\n if (price_.taxed) {\n return price_.taxed.total;\n }\n\n if (price_.untaxed) {\n return price_.untaxed.total;\n }\n\n return 0;\n })();\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const getSummary = useCallback(async () => {\n setLoading(true);\n setSummary({} as FragmentSummary);\n\n try {\n const { data: response } = await api.get(\n `/composition/${data.id}/price`,\n {\n params: {\n 'filter[locale_id]': data.locale_id,\n 'filter[price_type_id]': data.price_type_id,\n },\n },\n );\n\n const [summaryLoaded] = response.data;\n\n setSummary({\n total: summaryLoaded.total,\n material: summaryLoaded.material,\n material_percent: summaryLoaded.material_percent,\n equipment: summaryLoaded.equipment,\n equipment_percent: summaryLoaded.equipment_percent,\n labor: summaryLoaded.labor,\n labor_percent: summaryLoaded.labor_percent,\n third_party: summaryLoaded.third_party,\n third_party_percent: summaryLoaded.third_party_percent,\n other: summaryLoaded.other,\n other_percent: summaryLoaded.other_percent,\n });\n } catch (err) {\n setSummary({} as FragmentSummary);\n } finally {\n setLoading(false);\n }\n }, [data]);\n\n useEffect(() => {\n getSummary();\n }, [getSummary]);\n\n return (\n \n \n \n Detalhes da composição\n\n \n\n \n \n \n \n\n \n \n Código\n \n {data.code} / {data.base}\n \n \n\n \n Descrição\n \n {data.description}\n \n \n \n\n \n \n Valor unitário\n\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(price)}\n \n \n\n \n Classe\n \n {data.classification}\n \n \n\n \n Tipo\n \n {data.type}\n \n \n\n \n Unidade\n \n {data.unit_measure}\n \n \n \n\n \n \n \n \n );\n};\n\nexport default ModalCompositionLookup;\n","export const stateDescriptionByKey: Record = {\n AC: 'Acre',\n AL: 'Alagoas',\n AP: 'Amapá',\n AM: 'Amazonas',\n BA: 'Bahia',\n CE: 'Ceará',\n DF: 'Distrito Federal',\n ES: 'Espírito Santo',\n GO: 'Goías',\n MA: 'Maranhão',\n MT: 'Mato Grosso',\n MS: 'Mato Grosso do Sul',\n MG: 'Minas Gerais',\n PA: 'Pará',\n PB: 'Paraíba',\n PR: 'Paraná',\n PE: 'Pernambuco',\n PI: 'Piauí',\n RJ: 'Rio de Janeiro',\n RN: 'Rio Grande do Norte',\n RS: 'Rio Grande do Sul',\n RO: 'Rondônia',\n RR: 'Roraíma',\n SC: 'Santa Catarina',\n SP: 'São Paulo',\n SE: 'Sergipe',\n TO: 'Tocantins',\n};\n","import React from 'react';\n\nimport { stateDescriptionByKey } from 'shared/locale';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n TableContainer,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport { Table, Thead, Tbody, Tr, Th, Td } from 'components/Table';\n\ninterface ModalCompositionPrices extends ModalRootProps {\n data: {\n composition_description: string;\n prices: string;\n };\n}\n\ntype Prices = {\n taxed: { total: number };\n untaxed: { total: number };\n};\n\ntype PricesMap = {\n locale: string;\n taxed_total: number | null;\n untaxed_total: number | null;\n};\n\nfunction sortLocales(a: PricesMap, b: PricesMap): number {\n if (a.locale < b.locale) return -1;\n if (a.locale > b.locale) return 1;\n return 0;\n}\n\nconst ModalCompositionPricesLookup: React.FC = ({\n data,\n ...restProps\n}) => {\n const mappedPrices = (() => {\n const prices = JSON.parse(data.prices);\n const entries = Object.entries(prices);\n\n const pricesMap = entries\n .map(([locale, price]) => {\n return {\n locale: stateDescriptionByKey[locale],\n taxed_total: price.taxed ? price.taxed.total : null,\n untaxed_total: price.untaxed ? price.untaxed.total : null,\n };\n })\n .sort(sortLocales);\n\n return pricesMap;\n })();\n\n return (\n \n \n \n Preços da composição\n\n \n\n \n \n {data.composition_description}\n \n\n \n \n \n \n \n \n \n \n \n \n {mappedPrices.map((item, i) => (\n \n \n \n \n \n ))}\n \n
EstadoDesoneradoNão desonerado
{item.locale}\n {item.untaxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.untaxed_total)\n : null}\n \n {item.taxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.taxed_total)\n : null}\n
\n
\n
\n
\n
\n );\n};\n\nexport default ModalCompositionPricesLookup;\n","import React, { useCallback, useState, useContext } from 'react';\n\nimport { api } from 'services/api';\nimport { isSuperAdmin } from 'shared/roles';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n FormControl,\n FormLabel,\n Input,\n HStack,\n Textarea,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport AuthContext from 'contexts/AuthContext';\n\ntype ModalGPTModelProps = ModalRootProps & {\n data: {\n budgetId: number;\n prompt: string;\n model: string;\n };\n};\n\nconst ModalGPTModel: React.FC = ({\n data,\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n\n const [model, setModel] = useState(data.model);\n const [prompt, setPrompt] = useState(data.prompt);\n\n const handleSubmitValues = useCallback(async () => {\n if (!model || !prompt) {\n toast({\n status: 'error',\n title: 'Preencha todos os campos.',\n });\n\n return;\n }\n\n if (!isSuperAdmin(user)) {\n toast({\n status: 'error',\n title: 'Acesso negado.',\n });\n\n return;\n }\n\n try {\n await api.post(`/parametric/budget/${data.budgetId}`, {\n model,\n prompt,\n });\n\n await api.post(`/parametric/budget/${data.budgetId}/calculate`);\n\n toast({\n description: `Orçamento paramétrico solicitado com sucesso! Você será notificado quando estiver pronto.`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar gerar o orçamento.',\n status: 'error',\n });\n }\n }, [handleClose, onConfirm, user, model, prompt, data.budgetId]);\n\n return (\n \n \n \n Curva ABC\n\n \n\n \n *': {\n marginY: 1,\n },\n }}\n >\n \n \n Modelo GPT\n\n setModel(e.target.value)}\n />\n \n\n \n Prompt\n\n setPrompt(e.target.value)}\n resize=\"none\"\n rows={10}\n />\n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n};\n\nexport default ModalGPTModel;\n","import React, {\n useState,\n useCallback,\n useMemo,\n useEffect,\n useContext,\n} from 'react';\nimport { useDropzone } from 'react-dropzone';\n\nimport { InfoCircleFill as InfoCircleFillIcon } from '@styled-icons/bootstrap/InfoCircleFill';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Input,\n Tooltip,\n Icon,\n Box,\n Progress,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Base, Version } from 'types/base';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n type: 'own_input' | 'own_composition';\n };\n}\n\nconst baseStyle: React.CSSProperties = {\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n padding: '20px',\n borderWidth: 2,\n borderRadius: 4,\n borderColor: '#eeeeee',\n borderStyle: 'dashed',\n backgroundColor: '#fafafa',\n color: '#bdbdbd',\n outline: 'none',\n transition: 'border .24s ease-in-out',\n cursor: 'pointer',\n textAlign: 'center',\n fontSize: '14px',\n};\n\nconst focusedStyle = {\n borderColor: '#2196f3',\n};\n\nconst selectedStyle = {\n borderColor: '#2196f3',\n color: '#2196f3',\n};\n\nconst acceptStyle = {\n borderColor: '#00e676',\n color: '#00e676',\n};\n\nconst rejectStyle = {\n borderColor: '#ff1744',\n color: '#ff1744',\n};\n\nconst MotionBox = motion(Box);\n\nconst ModalImport: React.FC = ({\n data: { type = 'own_input' },\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n\n const [bases, setBases] = useState([]);\n const [selectedBase, setSelectedBase] = useState();\n const [isLoadingBases, setIsLoadingBases] = useState(false);\n\n const [baseVersions, setBaseVersions] = useState([]);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState();\n const [isLoadingBaseVersions, setIsLoadingBaseVersions] = useState(false);\n\n const [progress, setProgress] = useState(0);\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState({} as FormErrors);\n\n const [file, setFile] = React.useState(null);\n const [headerLine, setHeaderLine] = React.useState();\n\n const getBases = useCallback(async () => {\n setIsLoadingBases(true);\n\n try {\n const { data: response } = await api.get('/base', {\n params: {\n sort: `description`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n },\n });\n const basesLoaded = response.data;\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n setErrors({ ...errors, base: false });\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setIsLoadingBases(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n const getBaseVersions = useCallback(async (baseId?: number) => {\n if (!baseId) {\n setBaseVersions([]);\n return;\n }\n\n try {\n setIsLoadingBaseVersions(true);\n const { data: response } = await api.get('version', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const baseVersionsLoaded = response.data;\n setBaseVersions(baseVersionsLoaded);\n\n if (baseVersionsLoaded.length === 1) {\n const [baseVersion] = baseVersionsLoaded;\n setSelectedBaseVersion(baseVersion.id);\n setErrors({ ...errors, baseVersion: false });\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as versões da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseVersions(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseVersionsToSelect = useMemo(() => {\n return baseVersions.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [baseVersions]);\n\n useEffect(() => {\n getBaseVersions(selectedBase);\n }, [getBaseVersions, selectedBase]);\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n const value = selected ? Number(selected.value) : undefined;\n\n setSelectedBase(value);\n };\n\n const onDrop = useCallback((acceptedFiles) => {\n setFile(acceptedFiles[0]);\n }, []);\n\n const accept = {\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': [\n '.xlsx',\n '.xls',\n ],\n 'text/csv': ['.csv'],\n };\n\n const {\n getRootProps,\n getInputProps,\n isDragActive,\n isFocused,\n isDragAccept,\n isDragReject,\n } = useDropzone({\n accept,\n onDrop,\n });\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!headerLine) {\n formErrors.header = 'Linha do cabeçalho é obrigatório';\n }\n\n if (!file) {\n formErrors.file = 'Arquivo é obrigatório';\n }\n\n if (!selectedBase) {\n formErrors.base = 'Base é obrigatório';\n }\n\n if (!selectedBaseVersion) {\n formErrors.baseVersion = 'Versão da base é obrigatório';\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length || !file) {\n return;\n }\n\n try {\n setLoading(true);\n\n const formData = new FormData();\n formData.append('type', type);\n formData.append('header_row', String(headerLine));\n formData.append('description', String(file.name));\n formData.append('version_id', String(selectedBaseVersion));\n formData.append('file', file);\n\n const {\n data: {\n id: importId,\n mapped_header: mappedHeaders,\n header_row: headerRow,\n version,\n file: importedFile,\n },\n } = await api\n .post(`/import`, formData, {\n onUploadProgress: (progressEvent) => {\n const uploadPercentage = Math.round(\n (progressEvent.loaded * 100) / progressEvent.total,\n );\n\n if (uploadPercentage < 100) {\n setProgress(uploadPercentage);\n }\n },\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n })\n .then((response) => {\n setProgress(100);\n\n return response.data;\n });\n\n if (onConfirm)\n onConfirm({\n id: importId,\n mappedHeaders,\n headerRow,\n baseId: selectedBase,\n baseName: version?.base?.description || 'Não definido',\n versionName: version?.description || 'Não definido',\n fileName: importedFile.name,\n });\n\n handleClose();\n } catch (err) {\n setProgress(0);\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n const style = useMemo(\n () => ({\n ...baseStyle,\n ...(file ? selectedStyle : {}),\n ...(isFocused ? focusedStyle : {}),\n ...(isDragAccept ? acceptStyle : {}),\n ...(isDragReject ? rejectStyle : {}),\n ...(errors.file ? rejectStyle : {}),\n }),\n [isFocused, isDragAccept, isDragReject, file, errors],\n );\n\n useEffect(() => {\n if (file && errors.file) {\n const newErrors = errors;\n delete newErrors.file;\n setErrors(newErrors);\n }\n }, [file, errors]);\n\n const extensions = Object.values(accept).flat().join(', ');\n\n const dropMessage = useMemo(() => {\n if (file) {\n return `Selecionado: ${file.name}`;\n }\n\n if (isDragAccept) {\n return 'Tudo certo! Pode soltar os arquivos aqui.';\n }\n\n if (isDragReject) {\n return `Tipo de arquivo não suportado. Tipos suportados: ${extensions}.`;\n }\n\n if (isDragActive) {\n return 'Solte os arquivos aqui...';\n }\n\n return 'Arraste ou clique para selecionar o arquivo do orçamento.';\n }, [file, extensions, isDragAccept, isDragReject, isDragActive]);\n\n return (\n \n \n \n Importar Excel / CSV\n\n \n\n \n \n Base de dados\n Number(s.value) === selectedBase,\n )}\n isLoading={isLoadingBases}\n isDisabled={isLoadingBases || basesToSelect.length === 0}\n // isClearable\n onChange={handleBaseChange}\n />\n \n\n \n Referência\n\n Number(s.value) === selectedBaseVersion,\n )}\n isLoading={isLoadingBases || isLoadingBaseVersions}\n isDisabled={\n isLoadingBaseVersions || baseVersionsToSelect.length === 0\n }\n // isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : undefined;\n\n setSelectedBaseVersion(value);\n }}\n />\n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Arquivo\n\n
\n \n\n

{dropMessage}

\n
\n\n \n {!!errors?.file && 'Arquivo é obrigatório'}\n \n
\n\n \n \n Linha do cabeçalho{' '}\n \n \n \n \n\n {\n if (e.target.value === '') {\n setHeaderLine(undefined);\n return;\n }\n\n const value = Number(e.target.value);\n\n if (value < 1) {\n return;\n }\n\n setHeaderLine(value);\n }}\n onKeyPress={(e) => {\n if (e.key === 'Enter') {\n handleConfirm();\n }\n }}\n />\n\n \n {!!errors?.header && 'Linha do cabeçalho é obrigatória'}\n \n \n\n \n {progress > 0 && progress <= 100 ? (\n \n \n Enviando arquivo...\n \n \n \n ) : null}\n \n
\n\n \n \n Próximo\n \n \n
\n
\n );\n};\n\nexport default ModalImport;\n","import React, { useMemo, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n Input,\n Grid,\n Text,\n Heading,\n Select,\n FormErrorMessage,\n FormLabel,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Header = {\n [column: string]: string | number;\n};\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n mappedHeaders: Header;\n headerRow: number;\n baseId: number;\n baseName: string;\n versionName: string;\n fileName: string;\n };\n}\n\nconst ModalImport: React.FC = ({\n onConfirm,\n handleClose,\n data: { importId, mappedHeaders, headerRow, baseName, versionName, fileName },\n ...restProps\n}) => {\n const [headers, setHeaders] = useState
(mappedHeaders);\n const actualHeaders = useMemo(() => Object.keys(headers), [headers]);\n\n const [isUpdatingHeader, setIsUpdatingHeader] = useState(false);\n const [newHeaderLine, setNewHeaderLine] = useState(0);\n\n const [errors, setErrors] = useState({} as FormErrors);\n const [loading, setLoading] = useState(false);\n\n const [fields, setFields] = useState({\n type_: '',\n code: '',\n composition_code: '',\n composition_type: '',\n class: '',\n description: '',\n unit_measure: '',\n unit_price: '',\n coefficient: '',\n untaxed_price: '',\n taxed_price: '',\n });\n\n const mappedColumns = useMemo(() => {\n return {\n type: fields.type_,\n code: fields.code,\n composition_code: fields.composition_code,\n composition_type: fields.composition_type,\n class: fields.class,\n description: fields.description,\n unit_measure: fields.unit_measure,\n unit_price: fields.unit_price,\n coefficient: fields.coefficient,\n };\n }, [fields]);\n\n const handleUpdateHeader = async (): Promise => {\n try {\n setLoading(true);\n\n const {\n data: {\n data: { mapped_header },\n },\n } = await api.put(`/import/${importId}`, {\n header_row: newHeaderLine,\n });\n\n setHeaders(mapped_header);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao atualizar a linha do cabeçalho',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!fields.type_) {\n formErrors.type_ = 'Tipo é obrigatório';\n }\n\n if (!fields.code) {\n formErrors.code = 'Código é obrigatório';\n }\n\n if (!fields.composition_code) {\n formErrors.composition_code = 'Código da composição é obrigatório';\n }\n\n if (!fields.composition_type) {\n formErrors.composition_type = 'Tipo da composição é obrigatório';\n }\n\n if (!fields.class) {\n formErrors.class = 'Classe é obrigatório';\n }\n\n if (!fields.description) {\n formErrors.description = 'Descrição é obrigatório';\n }\n\n if (!fields.unit_measure) {\n formErrors.unit_measure = 'Unidade é obrigatório';\n }\n\n if (!fields.unit_price) {\n formErrors.unit_price = 'Preço é obrigatório';\n }\n\n if (!fields.coefficient) {\n formErrors.coefficient = 'Coeficiente é obrigatório';\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n const {\n data: {\n data: { id },\n },\n } = await api.put(`/import/${importId}`, {\n mapped_columns: mappedColumns,\n header_row: newHeaderLine || headerRow,\n });\n\n if (onConfirm) onConfirm(id);\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Configurar campos\n\n \n Base: {baseName}\n /\n Referência: {versionName}\n /\n Arquivo: {fileName}\n \n\n \n\n \n \n Indique a coluna do arquivo importado que corresponda a cada campo\n do orçamento\n \n\n \n \n Orçamento\n \n \n Arquivo importado (Colunas)\n \n \n\n \n \n \n \n\n \n {\n setFields({ ...fields, type_: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.type_ && 'Tipo é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, code: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.code && 'Código é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, composition_code: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.composition_code && 'Código é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, composition_type: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.composition_type && 'Tipo é obrigatório'}\n \n \n\n \n \n\n
\n
\n\n \n {\n setFields({ ...fields, class: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.class && 'Classe do insumo é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, description: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.description && 'Código é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_measure: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_measure && 'Código é obrigatório'}\n \n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_price: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_price && 'Preço é obrigatório'}\n \n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, coefficient: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.coefficient && 'Preço é obrigatório'}\n \n \n \n \n\n {\n setIsUpdatingHeader(true);\n }}\n >\n Modificar linha do cabeçalho\n \n\n {isUpdatingHeader && (\n <>\n \n Selecione a nova linha do cabeçalho\n {\n setNewHeaderLine(Number(e.target.value));\n }}\n />\n \n\n {\n await handleUpdateHeader();\n setIsUpdatingHeader(false);\n }}\n >\n Atualizar\n \n \n )}\n
\n\n \n \n Próximo\n \n \n
\n
\n );\n};\n\nexport default ModalImport;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\ntype Status = 'error' | 'warning' | 'success' | 'all';\n\ntype Props = {\n status: Status;\n};\n\nconst ImportStatusBadge: React.FC = ({ status }: Props) => {\n const getBadgeColor = (s: Status): string => {\n switch (s) {\n case 'error':\n return 'red';\n case 'warning':\n return 'yellow';\n case 'success':\n return 'green';\n case 'all':\n return 'gray';\n default:\n return 'gray';\n }\n };\n\n const getBadgeDescription = (s: Status): string => {\n switch (s) {\n case 'error':\n return 'Erro';\n case 'warning':\n return 'Aviso';\n case 'success':\n return 'Sucesso';\n default:\n return 'Não definido';\n }\n };\n\n const color = getBadgeColor(status);\n const description = getBadgeDescription(status);\n\n return (\n \n {description}\n \n );\n};\n\nexport default ImportStatusBadge;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { ImportPreview, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n compositionCode: number;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst ElementPreviewTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original._index;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n compositionCode: row.original._source.raw_data.code,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default ElementPreviewTableRow;\n","import React, { useCallback, useMemo, useEffect, useState } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport { TrafficCone as TrafficConeIcon } from '@styled-icons/entypo/TrafficCone';\nimport { StyledIcon } from '@styled-icons/styled-icon';\nimport { MdiReactIconComponentType } from 'mdi-react';\nimport BricksIcon from 'mdi-react/BricksIcon';\nimport CardAccountDetails from 'mdi-react/CardAccountDetailsIcon';\nimport GroupIcon from 'mdi-react/GroupIcon';\nimport InfoIcon from 'mdi-react/InfoCircleOutlineIcon';\nimport ShovelIcon from 'mdi-react/ShovelIcon';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Icon,\n Box,\n SimpleGrid,\n Select,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { ServicePagination, Pagination } from 'types/pagination';\n\nimport ImportStatusBadge from '../StatusBadge';\nimport ElementPreviewRow from './ElementPreviewTableRow';\nimport { ImportPreview, Row } from './types';\n\ntype Props = {\n importId: number;\n compositionCode: number;\n};\n\ntype Status = 'all' | 'error' | 'warning' | 'success';\n\nconst ElementPreviewTable: React.FC = ({\n importId,\n compositionCode,\n}) => {\n const [importPreview, setImportPreview] = useState([]);\n const [loading, setLoading] = useState(false);\n const [status, setStatus] = useState('all');\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getImportPreview = useCallback(async () => {\n setLoading(true);\n try {\n const { data: responseData } = await api.get(\n `/import/${importId}/preview`,\n {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[status]': status === 'all' ? undefined : status,\n 'filter[composition_code]': compositionCode,\n 'filter[_index]': 'import_element.*',\n },\n },\n );\n setImportPreview(responseData.data);\n setServicePagination({\n last_page: responseData.meta.last_page,\n });\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao obter o preview do arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [importId, pagination, compositionCode, status]);\n\n useEffect(() => {\n getImportPreview();\n }, [getImportPreview]);\n\n const shouldShowInputIcon = (i: ImportPreview): boolean => {\n return ['M', 'E', 'L', 'S'].includes(i._source.data?.class?.key || '');\n };\n\n type InputIcon = MdiReactIconComponentType | StyledIcon | undefined;\n const getInputIcon = useCallback((i: ImportPreview): InputIcon => {\n const value = i._source.data?.class?.key;\n\n if (!value) {\n return undefined;\n }\n\n if (value === 'M') {\n return BricksIcon;\n }\n\n if (value === 'E') {\n return TrafficConeIcon;\n }\n\n if (value === 'L') {\n return ShovelIcon;\n }\n\n if (value === 'S') {\n return CardAccountDetails;\n }\n\n return undefined;\n }, []);\n\n const getInputTitle = useCallback((i: ImportPreview): string => {\n const value = i._source.data?.class?.key;\n\n if (!value) {\n return '';\n }\n\n if (value === 'M') {\n return 'Material';\n }\n\n if (value === 'E') {\n return 'Equipamento';\n }\n\n if (value === 'L') {\n return 'Mão de obra';\n }\n\n if (value === 'S') {\n return 'Serviço de terceiros';\n }\n\n return '';\n }, []);\n\n const columns = useMemo(\n () => [\n {\n id: 'expander',\n Header: 'Tipo',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._index.includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n\n {row.original._index.includes('composition') && (\n \n \n \n )}\n\n {row.original._index.includes('input') && (\n \n \n \n )}\n\n {shouldShowInputIcon(row.original) && (\n \n \n \n )}\n \n );\n },\n },\n {\n Header: 'Linha',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.index;\n },\n },\n {\n Header: 'Descrição',\n width: '40%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._source.raw_data.description || '-'}\n \n );\n },\n },\n {\n Header: 'Código',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.code || '-';\n },\n },\n {\n Header: 'Unidade',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.unit_measure;\n },\n },\n {\n Header: 'Valor unit',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original._source.raw_data.unit_price;\n\n return value\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value)\n : '-';\n },\n },\n {\n Header: 'Status',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return ;\n },\n },\n {\n Header: 'Erros',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return (\n row.original._source?.message && (\n \n {Object.keys(row.original._source?.message).length > 0\n ? Object.values(row.original._source?.message).join(', ')\n : '-'}\n \n )\n );\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n const getRowId = useCallback((row) => {\n return row._id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n columns,\n data: importPreview,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ compositionCode: nextCompositionCode }) => (\n \n ),\n [importId],\n );\n\n return (\n <>\n \n \n \n Por página:\n \n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n \n Status:\n \n {\n setStatus(e.target.value as Status);\n }}\n >\n {[\n ['all', 'Todos'],\n ['success', 'Sucesso'],\n ['warning', 'Atenção'],\n ['error', 'Erro'],\n ].map(([key, description]) => (\n \n ))}\n \n \n \n\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && importPreview.length === 0 && (\n \n \n Nenhum dado encontrado\n \n \n )}\n \n
\n
\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n );\n};\n\nexport default ElementPreviewTable;\n","import React, { useRef } from 'react';\nimport { ColumnInstance } from 'react-table';\n\nimport { Tr, Td, TableRowProps } from '@chakra-ui/react';\n\nimport { ImportPreview, Row } from './types';\n\ninterface RowProps {\n visibleColumns: ColumnInstance[];\n renderRowSubComponent: (params: {\n compositionCode: number;\n }) => React.ReactElement;\n row: Row;\n}\n\nconst ImportPreviewTableRow: React.FC = ({\n visibleColumns,\n renderRowSubComponent,\n row,\n ...restProps\n}) => {\n const ref = useRef(null);\n\n function getType(tableRow: Row): string {\n return tableRow.original._index;\n }\n\n function isComposition(tableRow: Row): boolean {\n return getType(tableRow).includes('composition');\n }\n\n function getCustomRowExpandedProps(tableRow: Row): TableRowProps {\n return {\n ...row.getToggleRowExpandedProps(),\n title: 'Detalhar composição',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'inherit',\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n _hover: {\n color: tableRow.isExpanded ? 'white' : 'gray.800',\n backgroundColor: tableRow.isExpanded ? 'brand.500' : 'gray.200',\n },\n };\n }\n\n return (\n <>\n \n {row.cells.map((cell) => {\n return (\n \n {cell.render('Cell')}\n \n );\n })}\n \n\n {row.isExpanded ? (\n table': {\n backgroundColor: 'white',\n borderBottom: 'none',\n },\n }}\n >\n \n {isComposition(row) &&\n renderRowSubComponent({\n compositionCode: row.original._source.raw_data.code,\n })}\n \n \n ) : null}\n \n );\n};\n\nexport default ImportPreviewTableRow;\n","import React, { useCallback, useMemo, useEffect } from 'react';\nimport { useExpanded, useTable } from 'react-table';\n\nimport { DownArrow as DownArrowIcon } from '@styled-icons/boxicons-solid/DownArrow';\nimport { RightArrow as RightArrowIcon } from '@styled-icons/boxicons-solid/RightArrow';\nimport GroupIcon from 'mdi-react/GroupIcon';\n\nimport {\n Table,\n TableContainer,\n Tbody,\n Td,\n Text,\n Th,\n Thead,\n Tr,\n HStack,\n Icon,\n Box,\n} from '@chakra-ui/react';\n\nimport Loader from 'components/Loader';\n\nimport ImportStatusBadge from '../StatusBadge';\nimport ElementPreviewTable from './ElementPreviewTable';\nimport ImportPreviewRow from './ImportPreviewTableRow';\nimport { ImportPreview, Row } from './types';\n\ntype Props = {\n data: ImportPreview[];\n importId: number;\n loading?: boolean;\n};\n\nconst ImportPreviewTable: React.FC = ({ data, loading, importId }) => {\n const [importPreview, setImportPreview] = React.useState(data);\n\n useEffect(() => {\n setImportPreview(data);\n }, [data]);\n\n const columns = useMemo(\n () => [\n {\n id: 'expander',\n Header: 'Tipo',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._index.includes('composition') &&\n (row.isExpanded ? (\n \n ) : (\n \n ))}\n\n \n \n \n \n );\n },\n },\n {\n Header: 'Linha',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.index;\n },\n },\n {\n Header: 'Descrição',\n width: '40%',\n Cell: ({ row }: { row: Row }) => {\n return (\n \n {row.original._source.raw_data.description || '-'}\n \n );\n },\n },\n {\n Header: 'Código',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.code || '-';\n },\n },\n {\n Header: 'Unidade',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n return row.original._source.raw_data.unit_measure;\n },\n },\n {\n Header: 'Valor unit',\n width: '5%',\n Cell: ({ row }: { row: Row }) => {\n const value = row.original._source.raw_data.unit_price;\n\n return value\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(value)\n : '-';\n },\n },\n {\n Header: 'Status',\n width: '1%',\n Cell: ({ row }: { row: Row }) => {\n return ;\n },\n },\n {\n Header: 'Erros',\n width: '10%',\n Cell: ({ row }: { row: Row }) => {\n return (\n row.original._source?.message && (\n \n {Object.keys(row.original._source?.message).length > 0\n ? Object.values(row.original._source?.message).join(', ')\n : '-'}\n \n )\n );\n },\n },\n ],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n const getRowId = useCallback((row) => {\n return row._id;\n }, []);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n visibleColumns,\n } = useTable(\n {\n columns,\n data: importPreview,\n getRowId,\n },\n useExpanded,\n );\n\n const renderRowSubComponent = useCallback(\n ({ compositionCode }) => (\n \n ),\n [importId],\n );\n\n return (\n \n \n \n {headerGroups.map((headerGroup) => (\n \n {headerGroup.headers.map((column) => (\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n\n \n {!loading &&\n rows.length > 0 &&\n rows.map((row) => {\n prepareRow(row);\n\n return (\n \n );\n })}\n\n {loading && (\n \n \n \n \n \n )}\n\n {!loading && data.length === 0 && (\n \n \n Suas importações aparecerão aqui.\n \n \n )}\n \n
\n
\n );\n};\n\nexport default ImportPreviewTable;\n","import React, { useState, useCallback, useEffect, useRef } from 'react';\nimport { useQuery } from 'react-query';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { Globe as GlobeIcon } from '@styled-icons/boxicons-regular/Globe';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Heading,\n Progress,\n HStack,\n Text,\n Box,\n useMediaQuery,\n Select,\n SimpleGrid,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport SummaryCard from 'components/SummaryCard';\nimport SummaryContainer from 'components/SummaryContainer';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Import } from 'types/import';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport ImportPreviewTable from './ImportPreviewTable';\nimport { ImportPreview } from './types';\n\ntype Status = 'all' | 'error' | 'warning' | 'success';\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n };\n}\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalImport: React.FC = ({\n data: { importId },\n handleClose,\n ...restProps\n}) => {\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [refetchInterval, setRefetchInterval] = useState(1000 * 1); // 1 second\n const [saving, setSaving] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const scrollingBody = useRef(null);\n const targetElement = useRef(null);\n\n const [status, setStatus] = useState('all');\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [importPreview, setImportPreview] = useState([]);\n const [summary, setSummary] = useState({\n total: 0,\n success: 0,\n error: 0,\n });\n\n const getImport = useCallback(async () => {\n const { data: responseData } = await api.get(`/import/${importId}`);\n return responseData.data as Import;\n }, [importId]);\n\n const getImportPreview = useCallback(async () => {\n setLoading(true);\n try {\n const { data: responseData } = await api.get(\n `/import/${importId}/preview`,\n {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[status]': status === 'all' ? undefined : status,\n 'filter[_index]': 'import_element.own_composition',\n 'filter[composition_code]': 'NULL',\n },\n },\n );\n setImportPreview(responseData.data);\n setSummary({\n total: responseData.meta.total,\n success: responseData.summary?.status?.success || 0,\n error: responseData.summary?.status?.error || 0,\n });\n setServicePagination({\n last_page: responseData.meta.last_page,\n });\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao obter o preview do arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [importId, pagination, status]);\n\n const queryImport = useQuery(['Import', importId], getImport, {\n refetchInterval,\n refetchOnWindowFocus: false,\n onSuccess: (data) => {\n if (data.status !== 'processing' && data.status !== 'storing') {\n setRefetchInterval(1000 * 30); // 30 seconds\n }\n },\n });\n\n // const queryPreview = useQuery(['ImportPreview', importId], getImportPreview, {\n // refetchInterval,\n // refetchOnWindowFocus: false,\n // });\n\n const isImporting = queryImport.data?.status === 'processing';\n const isStoring = queryImport.data?.status === 'storing';\n\n useEffect(() => {\n if (!isImporting) {\n getImportPreview();\n }\n }, [getImportPreview, isImporting]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n const handleConfirm = async (): Promise => {\n if (scrollingBody.current && targetElement.current) {\n scrollingBody.current.scrollTo({\n top: targetElement.current.offsetTop - 500,\n behavior: 'smooth',\n });\n }\n\n try {\n setSaving(true);\n await api.post(`/import/${importId}/persist`);\n\n toast({\n description: 'Os dados serão salvos na base.',\n status: 'success',\n });\n\n setRefetchInterval(1000 * 1); // 1 second\n\n // handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setSaving(false);\n }\n };\n\n return (\n \n \n \n Resumo do processamento\n\n {queryImport.data?.version && (\n \n Base: {queryImport.data.version.base.description}\n /\n Referência: {queryImport.data.version.description}\n \n )}\n\n \n\n \n \n \n\n \n\n \n \n\n \n {queryImport.data?.file &&\n `Arquivo: \"${queryImport.data?.file.name}\"`}\n \n\n {queryImport.data?.progress_bar && (\n \n {isImporting || isStoring\n ? 'Importação iniciada'\n : 'Importação realizada'}{' '}\n {queryImport.data?.progress_bar?.elapsed_for_humans} (\n {formatDate(queryImport.data?.progress_bar?.start_time_iso)})\n \n )}\n\n {(isImporting || isStoring) && (\n \n )}\n\n {(isImporting || isStoring) && (\n \n \n Tempo restante:{' '}\n {queryImport.data?.progress_bar?.remaining_for_humans}\n \n\n \n Tempo estimado:{' '}\n {queryImport.data?.progress_bar?.estimated_for_humans}\n \n \n )}\n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n Status:\n {\n setStatus(e.target.value as Status);\n }}\n >\n {[\n ['all', 'Todos'],\n ['success', 'Sucesso'],\n ['warning', 'Atenção'],\n ['error', 'Erro'],\n ].map(([key, description]) => (\n \n ))}\n \n \n \n\n \n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n\n \n \n \n\n \n Consolidar importação (salvar dados na base)\n \n \n \n \n \n );\n};\n\nexport default ModalImport;\n","import React, { useMemo, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n Input,\n Grid,\n Text,\n Heading,\n Select,\n FormErrorMessage,\n FormLabel,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Header = {\n [column: string]: string | number;\n};\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n mappedHeaders: Header;\n headerRow: number;\n baseId: number;\n baseName: string;\n versionName: string;\n fileName: string;\n };\n}\n\nconst ModalImport: React.FC = ({\n onConfirm,\n handleClose,\n data: { importId, mappedHeaders, headerRow, baseName, versionName, fileName },\n ...restProps\n}) => {\n const [headers, setHeaders] = useState
(mappedHeaders);\n const actualHeaders = useMemo(() => Object.keys(headers), [headers]);\n\n const [isUpdatingHeader, setIsUpdatingHeader] = useState(false);\n const [newHeaderLine, setNewHeaderLine] = useState(0);\n\n const [errors, setErrors] = useState({} as FormErrors);\n const [loading, setLoading] = useState(false);\n\n const [fields, setFields] = useState({\n code: '',\n class: '',\n description: '',\n unit_measure: '',\n unit_price: '',\n untaxed_price: '',\n taxed_price: '',\n });\n\n const mappedColumns = useMemo(() => {\n return {\n code: fields.code,\n class: fields.class,\n description: fields.description,\n unit_measure: fields.unit_measure,\n unit_price: fields.unit_price,\n };\n }, [fields]);\n\n const handleUpdateHeader = async (): Promise => {\n try {\n setLoading(true);\n\n const {\n data: {\n data: { mapped_header },\n },\n } = await api.put(`/import/${importId}`, {\n header_row: newHeaderLine,\n });\n\n setHeaders(mapped_header);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao atualizar a linha do cabeçalho',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!fields.code) {\n formErrors.code = 'Código é obrigatório';\n }\n\n if (!fields.class) {\n formErrors.class = 'Classe é obrigatório';\n }\n\n if (!fields.description) {\n formErrors.description = 'Descrição é obrigatório';\n }\n\n if (!fields.unit_measure) {\n formErrors.unit_measure = 'Unidade é obrigatório';\n }\n\n if (!fields.unit_price) {\n formErrors.unit_price = 'Preço é obrigatório';\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n const {\n data: {\n data: { id },\n },\n } = await api.put(`/import/${importId}`, {\n mapped_columns: mappedColumns,\n header_row: newHeaderLine || headerRow,\n });\n\n if (onConfirm) onConfirm(id);\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Configurar campos\n\n \n Base: {baseName}\n /\n Referência: {versionName}\n \n\n \n Arquivo: {fileName}\n \n\n \n\n \n \n Indique a coluna do arquivo importado que corresponda a cada campo\n do orçamento\n \n\n \n \n Orçamento\n \n \n Arquivo importado (Colunas)\n \n \n\n \n \n \n \n\n \n {\n setFields({ ...fields, code: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.code && 'Código é obrigatório'}\n \n \n\n \n \n\n
\n
\n\n \n {\n setFields({ ...fields, class: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.class && 'Classe é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, description: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n \n\n \n {!!errors?.description && 'Código é obrigatório'}\n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_measure: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_measure && 'Código é obrigatório'}\n \n \n \n\n \n \n \n\n \n {\n setFields({ ...fields, unit_price: e.target.value });\n }}\n >\n \n {actualHeaders.map((column) => (\n \n ))}\n\n \n {!!errors?.unit_price && 'Preço é obrigatório'}\n \n \n \n \n\n {\n setIsUpdatingHeader(true);\n }}\n >\n Modificar linha do cabeçalho\n \n\n {isUpdatingHeader && (\n <>\n \n Selecione a nova linha do cabeçalho\n {\n setNewHeaderLine(Number(e.target.value));\n }}\n />\n \n\n {\n await handleUpdateHeader();\n setIsUpdatingHeader(false);\n }}\n >\n Atualizar\n \n \n )}\n
\n\n \n \n Próximo\n \n \n
\n
\n );\n};\n\nexport default ModalImport;\n","import React, { useState, useCallback, useEffect } from 'react';\nimport { useQuery } from 'react-query';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { Globe as GlobeIcon } from '@styled-icons/boxicons-regular/Globe';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Heading,\n Progress,\n HStack,\n Text,\n Box,\n useMediaQuery,\n Select,\n SimpleGrid,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport SummaryCard from 'components/SummaryCard';\nimport SummaryContainer from 'components/SummaryContainer';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Import } from 'types/import';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport ImportStatusBadge from '../StatusBadge';\n\ntype Status = 'all' | 'error' | 'warning' | 'success';\n\ninterface ModalImportProps extends ModalRootProps {\n data: {\n importId: number;\n };\n}\n\ntype ImportPreview = {\n _id: string;\n _source: {\n status: Status;\n raw_data: {\n class: string;\n code: number;\n description: string;\n unit_measure: string;\n unit_price: number;\n };\n index: string;\n message: {\n [key: string]: string[];\n };\n };\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalImport: React.FC = ({\n data: { importId },\n handleClose,\n ...restProps\n}) => {\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [refetchInterval, setRefetchInterval] = useState(1000 * 1); // 1 second\n const [saving, setSaving] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const [status, setStatus] = useState('all');\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [importPreview, setImportPreview] = useState([]);\n const [summary, setSummary] = useState({\n total: 0,\n success: 0,\n error: 0,\n });\n\n const getImport = useCallback(async () => {\n const { data: responseData } = await api.get(`/import/${importId}`);\n return responseData.data as Import;\n }, [importId]);\n\n const getImportPreview = useCallback(async () => {\n setLoading(true);\n try {\n const { data: responseData } = await api.get(\n `/import/${importId}/preview`,\n {\n params: {\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[status]': status === 'all' ? undefined : status,\n },\n },\n );\n setImportPreview(responseData.data);\n setSummary({\n total: responseData.meta.total,\n success: responseData.summary?.status?.success || 0,\n error: responseData.summary?.status?.error || 0,\n });\n setServicePagination({\n last_page: responseData.meta.last_page,\n });\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao obter o preview do arquivo.',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [importId, pagination, status]);\n\n const queryImport = useQuery(['Import', importId], getImport, {\n refetchInterval,\n refetchOnWindowFocus: false,\n onSuccess: (data) => {\n if (data.status !== 'processing' && data.status !== 'storing') {\n setRefetchInterval(1000 * 30); // 30 seconds\n }\n },\n });\n\n // const queryPreview = useQuery(['ImportPreview', importId], getImportPreview, {\n // refetchInterval,\n // refetchOnWindowFocus: false,\n // });\n\n const isImporting = queryImport.data?.status === 'processing';\n const isStoring = queryImport.data?.status === 'storing';\n\n useEffect(() => {\n if (!isImporting) {\n getImportPreview();\n }\n }, [getImportPreview, isImporting]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n const handleConfirm = async (): Promise => {\n try {\n setSaving(true);\n await api.post(`/import/${importId}/persist`);\n toast({\n description: 'Os dados serão salvos na base.',\n status: 'success',\n });\n\n setRefetchInterval(1000 * 1); // 1 second\n\n // handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro inesperado ao importar o arquivo.',\n status: 'error',\n });\n } finally {\n setSaving(false);\n }\n };\n\n return (\n \n \n \n Resumo do processamento\n\n {queryImport.data?.version && (\n \n Base: {queryImport.data.version.base.description}\n /\n Referência: {queryImport.data.version.description}\n \n )}\n\n \n\n \n \n \n\n \n\n \n \n\n \n {queryImport.data?.file &&\n `Arquivo: \"${queryImport.data?.file.name}\"`}\n \n\n {queryImport.data?.progress_bar && (\n \n {isImporting || isStoring\n ? 'Importação iniciada'\n : 'Importação realizada'}{' '}\n {queryImport.data?.progress_bar?.elapsed_for_humans} (\n {formatDate(queryImport.data?.progress_bar?.start_time_iso)})\n \n )}\n\n {(isImporting || isStoring) && (\n \n )}\n\n {(isImporting || isStoring) && (\n \n \n Tempo restante:{' '}\n {queryImport.data?.progress_bar?.remaining_for_humans}\n \n\n \n Tempo estimado:{' '}\n {queryImport.data?.progress_bar?.estimated_for_humans}\n \n \n )}\n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n Status:\n {\n setStatus(e.target.value as Status);\n }}\n >\n {[\n ['all', 'Todos'],\n ['success', 'Sucesso'],\n ['warning', 'Atenção'],\n ['error', 'Erro'],\n ].map(([key, description]) => (\n \n ))}\n \n \n \n\n ({\n id: item._id,\n line: item._source.index,\n description: (\n \n {item._source.raw_data.description || '-'}\n \n ),\n code: item._source.raw_data.code,\n class: item._source.raw_data.class,\n unit_measure: item._source.raw_data.unit_measure,\n unit_price: item._source.raw_data.unit_price,\n status: ,\n errors: (\n <>\n {item._source?.message && (\n \n {Object.keys(item._source?.message).length > 0\n ? Object.values(item._source?.message).join(', ')\n : '-'}\n \n )}\n \n ),\n actions: null,\n })}\n data={importPreview}\n noDataMessage=\"Suas importações aparecerão aqui.\"\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n\n \n \n \n\n \n Consolidar importação (salvar dados na base)\n \n \n \n \n \n );\n};\n\nexport default ModalImport;\n","import React from 'react';\n\nimport { stateDescriptionByKey } from 'shared/locale';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n TableContainer,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport { Table, Thead, Tbody, Tr, Th, Td } from 'components/Table';\n\ninterface ModalInputPrices extends ModalRootProps {\n data: {\n inputs_description: string;\n prices: string;\n };\n}\n\ntype Prices = {\n taxed: { total: number };\n untaxed: { total: number };\n};\n\ntype PricesMap = {\n locale: string;\n taxed_total: number | null;\n untaxed_total: number | null;\n};\n\nfunction sortLocales(a: PricesMap, b: PricesMap): number {\n if (a.locale < b.locale) return -1;\n if (a.locale > b.locale) return 1;\n return 0;\n}\n\nconst ModalInputPricesLookup: React.FC = ({\n data,\n ...restProps\n}) => {\n const mappedPrices = (() => {\n const prices = JSON.parse(data.prices);\n const entries = Object.entries(prices);\n\n const pricesMap = entries\n .map(([locale, price]) => {\n return {\n locale: stateDescriptionByKey[locale],\n taxed_total: price.taxed ? price.taxed.total : null,\n untaxed_total: price.untaxed ? price.untaxed.total : null,\n };\n })\n .sort(sortLocales);\n\n return pricesMap;\n })();\n\n return (\n \n \n \n Preços da composição\n\n \n\n \n \n {data.inputs_description}\n \n\n \n \n \n \n \n \n \n \n \n \n {mappedPrices.map((item, i) => (\n \n \n \n \n \n ))}\n \n
EstadoDesoneradoNão desonerado
{item.locale}\n {item.untaxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.untaxed_total)\n : null}\n \n {item.taxed_total\n ? Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.taxed_total)\n : null}\n
\n
\n
\n
\n
\n );\n};\n\nexport default ModalInputPricesLookup;\n","import React, { useState, useEffect, useMemo, useCallback } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport { Locale, PriceTypes } from 'types/base';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalLocaleAndPriceTypeSelectProps extends ModalRootProps {\n data: {\n base_id: number | null;\n };\n}\n\nconst ModalLocaleAndPriceTypeSelect: React.FC =\n ({ onConfirm, handleClose, data, ...restProps }) => {\n const { base_id } = data;\n\n const [baseLocales, setBaseLocales] = useState([]);\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [isLoadingBaseLocales, setIsLoadingBaseLocales] = useState(false);\n\n const [basePriceTypes, setBasePriceTypes] = useState([]);\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n const [isLoadingPriceTypes, setIsLoadingPriceTypes] = useState(false);\n\n const [errors, setErrors] = useState({} as FormErrors);\n\n const isLoadingFilters = isLoadingBaseLocales || isLoadingPriceTypes;\n\n const getBaseLocales = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBaseLocales([]);\n return;\n }\n\n try {\n setIsLoadingBaseLocales(true);\n const { data: response } = await api.get('locale', {\n params: {\n 'filter[base_id]': baseId,\n sort: 'description',\n },\n });\n const baseLocalesLoaded = response.data;\n setBaseLocales(baseLocalesLoaded);\n\n if (baseLocalesLoaded.length === 1) {\n const [baseLocale] = baseLocalesLoaded;\n setSelectedBaseLocale(baseLocale.id);\n\n if (errors.locale_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.locale_id;\n return newErrors;\n });\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os estados da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseLocales(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseLocalesToSelect = useMemo(() => {\n return baseLocales.map((locale) => ({\n value: String(locale.id),\n label: locale.description,\n }));\n }, [baseLocales]);\n\n useEffect(() => {\n getBaseLocales(base_id);\n }, [getBaseLocales, base_id]);\n\n const getBasePriceTypes = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBasePriceTypes([]);\n return;\n }\n\n try {\n setIsLoadingPriceTypes(true);\n const { data: response } = await api.get('price/type', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const basePriceTypesLoaded = response.data;\n setBasePriceTypes(basePriceTypesLoaded);\n\n if (basePriceTypesLoaded.length === 1) {\n const [basePriceType] = basePriceTypesLoaded;\n setSelectedBasePriceType(basePriceType.id);\n\n if (errors.type_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.type_id;\n return newErrors;\n });\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os tipos de preço da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingPriceTypes(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basePriceTypesToSelect = useMemo(() => {\n return basePriceTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [basePriceTypes]);\n\n useEffect(() => {\n getBasePriceTypes(base_id);\n }, [getBasePriceTypes, base_id]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!selectedBaseLocale) {\n Object.assign(formErrors, { locale_id: true, type: 'required' });\n }\n\n if (!selectedBasePriceType) {\n Object.assign(formErrors, { type_id: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n const locale = {\n id: selectedBaseLocale,\n key: baseLocales.find((l) => l.id === selectedBaseLocale)?.key,\n description: baseLocales.find((l) => l.id === selectedBaseLocale)\n ?.description,\n };\n\n const priceType = {\n id: selectedBasePriceType,\n key: basePriceTypes.find((t) => t.id === selectedBasePriceType)?.key,\n description: basePriceTypes.find((t) => t.id === selectedBasePriceType)\n ?.description,\n };\n\n if (onConfirm) onConfirm({ locale, priceType });\n handleClose();\n };\n\n return (\n \n \n \n Selecionar Estado e Tipo de Preço\n\n \n\n \n \n Estado\n\n Number(s.value) === selectedBaseLocale,\n )}\n isLoading={isLoadingBaseLocales}\n isDisabled={\n isLoadingBaseLocales || baseLocalesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseLocale(value);\n\n if (value && errors.locale_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.locale_id;\n return newErrors;\n });\n }\n }}\n />\n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n Number(s.value) === selectedBasePriceType,\n )}\n isLoading={isLoadingPriceTypes}\n isDisabled={\n isLoadingPriceTypes || basePriceTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBasePriceType(value);\n\n if (value && errors.type_id) {\n setErrors((prevErrors) => {\n const newErrors = { ...prevErrors };\n delete newErrors.type_id;\n return newErrors;\n });\n }\n }}\n />\n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Confirmar\n \n \n \n \n );\n };\n\nexport default ModalLocaleAndPriceTypeSelect;\n","import React, { Fragment, useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Flex,\n Text,\n Grid,\n Textarea,\n HStack,\n Box,\n keyframes,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport useModal from 'hooks/useModal';\n\nimport { Budget } from 'types/budget';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Action = Budget['flow_status']['actions'][number];\n\ninterface ModalManageFlowProps extends ModalRootProps {\n data: {\n budget: Budget;\n };\n}\n\nconst spin = keyframes`\n 0% {opacity: 0; scale: 0;}\n 50% {opacity: 0.3; scale: 1;}\n 100% {opacity: 0; scale: 0;}\n`;\n\ntype Option = {\n label: string;\n description: string;\n color: string;\n};\n\nconst formatOptionLabel = ({\n label,\n description,\n color,\n}: Option): JSX.Element => {\n const spinAnimation = `${spin} infinite 2s ease`;\n\n return (\n <>\n \n \n {label}\n \n {description}\n \n );\n};\n\nconst ModalManageFlow: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const { budget } = data;\n\n const { openModal } = useModal();\n\n const [selectedAction, setSelectedAction] = useState();\n\n const [observation, setObservation] = useState();\n\n const [actions, setData] = useState([]);\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState();\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get(\n `flow/status/${budget.flow_status.id}/action`,\n );\n\n const actionList = response.data;\n\n setData(actionList.data);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as ações!',\n status: 'error',\n });\n setData([]);\n } finally {\n setLoading(false);\n }\n }, [budget]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const actionsToSelect = actions.map((item) => ({\n value: item.id,\n label: item.name,\n description: item.description,\n color: item.color,\n }));\n\n type Client = Budget['identification']['client'];\n const clientNameByType = (client: Client): JSX.Element => {\n if (client.type_person === 'legal') {\n return (\n <>\n {client.fantasy_name}\n
\n {client.corporate_name}\n \n );\n }\n\n return <>{client.name};\n };\n\n const getClientName = useCallback((item: Budget): JSX.Element => {\n if (!item.identification) return -;\n\n if (item.identification.client) {\n return clientNameByType(item.identification.client);\n }\n\n return Não especificado;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleConfirm = async (): Promise => {\n const formErrors = {} as FormErrors;\n\n if (!selectedAction) {\n Object.assign(formErrors, { selectedAction: true, type: 'required' });\n }\n\n if (!observation) {\n Object.assign(formErrors, { observation: true, type: 'required' });\n }\n\n setErrors(formErrors);\n\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n await api.post(`/flow/action/${selectedAction?.id}`, {\n object_type: 'budget',\n object_id: budget.id,\n flow_key: 'use_flow',\n type: 'manual',\n message: observation,\n });\n\n toast({\n description: `Status atualizado com sucesso!`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao performar a ação!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Atualizar status do orçamento\n\n \n\n \n \n \n Descrição: \n \n {budget.identification.description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Cliente / Obra:\n \n {getClientName(budget)}\n \n \n\n \n Total: \n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(budget.total)}{' '}\n {`(${Intl.NumberFormat('pt-BR', {\n maximumFractionDigits: 2,\n }).format(\n budget.total_separate_percent || 0,\n )}% complementares)`}\n \n \n \n\n \n Ação\n {\n const value = actions.find(\n (item) => item.id === Number(selected?.value),\n );\n setSelectedAction(value);\n }}\n formatOptionLabel={formatOptionLabel}\n />\n Ação é obrigatória\n \n\n \n Justificativa\n setObservation(e.target.value)}\n />\n Justificativa é obrigatória\n \n \n\n \n \n \n openModal('budgetHistory', {\n mode: 'lookup',\n data: {\n budget,\n },\n })\n }\n >\n Ver histórico\n \n\n \n Salvar\n \n \n \n \n \n );\n};\n\nexport default ModalManageFlow;\n","import React, { Fragment, useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Flex,\n Text,\n Grid,\n Textarea,\n HStack,\n Box,\n keyframes,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\nimport OwnSelect from 'components/OwnSelect';\n\nimport useModal from 'hooks/useModal';\n\nimport { ParametricBudget } from 'types/budget/parametric-budget';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ntype Action = ParametricBudget['flow_status']['actions'][number];\n\ninterface ModalManageParametricFlowProps extends ModalRootProps {\n data: {\n budget: ParametricBudget;\n };\n}\n\nconst spin = keyframes`\n 0% {opacity: 0; scale: 0;}\n 50% {opacity: 0.3; scale: 1;}\n 100% {opacity: 0; scale: 0;}\n`;\n\ntype Option = {\n label: string;\n description: string;\n color: string;\n};\n\nconst formatOptionLabel = ({ label, color }: Option): JSX.Element => {\n const spinAnimation = `${spin} infinite 2s ease`;\n\n return (\n \n \n {label}\n \n );\n};\n\nconst ModalManageParametricFlow: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const { budget } = data;\n\n const { openModal } = useModal();\n\n const [selectedAction, setSelectedAction] = useState();\n\n const [observation, setObservation] = useState();\n\n const [actions, setData] = useState([]);\n\n const [loading, setLoading] = useState(false);\n const [errors, setErrors] = useState();\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get(\n `flow/status/${budget.flow_status.id}/action`,\n );\n\n const actionList = response.data;\n\n setData(actionList.data);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as ações!',\n status: 'error',\n });\n setData([]);\n } finally {\n setLoading(false);\n }\n }, [budget]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const actionsToSelect = actions.map((item) => ({\n value: item.id,\n label: item.name,\n description: item.description,\n color: item.color,\n }));\n\n type Organization = ParametricBudget['organization'];\n const getOrganizationName = (organization: Organization): JSX.Element => {\n if (organization.document_type === 'cnpj') {\n return (\n <>\n {organization.fantasy_name}\n
\n {organization.corporate_name}\n \n );\n }\n\n return <>{organization.name};\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors = {} as FormErrors;\n\n if (!selectedAction) {\n Object.assign(formErrors, { selectedAction: true, type: 'required' });\n }\n\n if (!observation) {\n Object.assign(formErrors, { observation: true, type: 'required' });\n }\n\n setErrors(formErrors);\n\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n await api.post(`/flow/action/${selectedAction?.id}`, {\n object_type: 'parametric_budget',\n object_id: budget.id,\n flow_key: 'use_flow',\n type: 'manual',\n message: observation,\n });\n\n toast({\n description: `Status atualizado com sucesso!`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao performar a ação!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Atualizar status do orçamento\n\n \n\n \n \n \n Descrição: \n \n {budget.build_description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Organização\n \n {getOrganizationName(budget.organization)}\n \n \n \n\n \n Ação\n {\n const value = actions.find(\n (item) => item.id === Number(selected?.value),\n );\n setSelectedAction(value);\n }}\n formatOptionLabel={formatOptionLabel}\n />\n Ação é obrigatória\n \n\n \n Justificativa\n setObservation(e.target.value)}\n />\n Justificativa é obrigatória\n \n \n\n \n \n \n openModal('parametricBudgetHistory', {\n mode: 'lookup',\n data: {\n budget,\n },\n })\n }\n >\n Ver histórico\n \n\n \n Salvar\n \n \n \n \n \n );\n};\n\nexport default ModalManageParametricFlow;\n","import React, {\n useCallback,\n useMemo,\n useState,\n useEffect,\n useContext,\n} from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport {\n Base,\n Version,\n Locale,\n UnitMeasure,\n PriceTypes,\n Classification,\n ClassificationType,\n} from 'types/base';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n classification_id: number | null;\n classification_type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst OWN_BASE_KEY_PREFIX = 'own.';\n\nconst SearchFilter: React.FC = ({ onSubmit, loading = false }) => {\n const { user } = useContext(AuthContext);\n\n const {\n handleSubmit,\n setValue,\n formState: { errors },\n control,\n register,\n clearErrors,\n } = useForm();\n\n const [bases, setBases] = useState([]);\n const [selectedBase, setSelectedBase] = useState(null);\n const [isLoadingBases, setIsLoadingBases] = useState(false);\n\n const selectedBaseObj = useMemo(\n () => bases.find((b) => b.id === Number(selectedBase)),\n [bases, selectedBase],\n );\n\n const [baseVersions, setBaseVersions] = useState([]);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [isLoadingBaseVersions, setIsLoadingBaseVersions] = useState(false);\n\n const [baseLocales, setBaseLocales] = useState([]);\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [isLoadingBaseLocales, setIsLoadingBaseLocales] = useState(false);\n\n const [basePriceTypes, setBasePriceTypes] = useState([]);\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n const [isLoadingPriceTypes, setIsLoadingPriceTypes] = useState(false);\n\n const [classifications, setClassifications] = useState([]);\n const [selectedClassification, setSelectedClassification] = useState<\n number | null\n >(null);\n const [isLoadingClassifications, setIsLoadingClassifications] =\n useState(false);\n\n const [classificationTypes, setClassificationTypes] = useState<\n ClassificationType[]\n >([]);\n const [selectedClassificationType, setSelectedClassificationType] = useState<\n number | null\n >(null);\n const [isLoadingTypes, setIsLoadingTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const getBases = useCallback(async () => {\n setIsLoadingBases(true);\n\n try {\n const { data: response } = await api.get('/base', {\n params: {\n 'filter[with_plan]': `.`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n sort: 'description',\n },\n });\n const basesLoaded = response.data;\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n setValue('base_id', base.id);\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setIsLoadingBases(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n const getBaseVersions = useCallback(\n async (baseId: number | null) => {\n if (!baseId) {\n setBaseVersions([]);\n return;\n }\n\n try {\n setIsLoadingBaseVersions(true);\n const { data: response } = await api.get('version', {\n params: {\n 'filter[base_id]': baseId,\n sort: selectedBaseObj?.key.startsWith(OWN_BASE_KEY_PREFIX)\n ? `-created_at`\n : `-pointer`,\n },\n });\n const baseVersionsLoaded = response.data;\n setBaseVersions(baseVersionsLoaded);\n\n if (baseVersionsLoaded.length === 1) {\n const [baseVersion] = baseVersionsLoaded;\n setSelectedBaseVersion(baseVersion.id);\n setValue('version_id', baseVersion.id);\n\n if (errors.version_id) {\n clearErrors('version_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as versões da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseVersions(false);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selectedBaseObj],\n );\n\n const baseVersionsToSelect = useMemo(() => {\n return baseVersions.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [baseVersions]);\n\n useEffect(() => {\n getBaseVersions(selectedBase);\n }, [getBaseVersions, selectedBase]);\n\n const getBaseLocales = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBaseLocales([]);\n return;\n }\n\n try {\n setIsLoadingBaseLocales(true);\n const { data: response } = await api.get('locale', {\n params: {\n 'filter[base_id]': baseId,\n sort: 'description',\n },\n });\n const baseLocalesLoaded = response.data;\n setBaseLocales(baseLocalesLoaded);\n\n if (baseLocalesLoaded.length === 1) {\n const [baseLocale] = baseLocalesLoaded;\n setSelectedBaseLocale(baseLocale.id);\n setValue('locale_id', baseLocale.id);\n\n if (errors.locale_id) {\n clearErrors('locale_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os estados da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseLocales(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseLocalesToSelect = useMemo(() => {\n return baseLocales.map((locale) => ({\n value: String(locale.id),\n label: locale.description,\n }));\n }, [baseLocales]);\n\n useEffect(() => {\n getBaseLocales(selectedBase);\n }, [getBaseLocales, selectedBase]);\n\n const getBasePriceTypes = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBasePriceTypes([]);\n return;\n }\n\n try {\n setIsLoadingPriceTypes(true);\n const { data: response } = await api.get('price/type', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const basePriceTypesLoaded = response.data;\n setBasePriceTypes(basePriceTypesLoaded);\n\n if (basePriceTypesLoaded.length === 1) {\n const [basePriceType] = basePriceTypesLoaded;\n setSelectedBasePriceType(basePriceType.id);\n setValue('type_id', basePriceType.id);\n\n if (errors.type_id) {\n clearErrors('type_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os tipos de preço da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingPriceTypes(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basePriceTypesToSelect = useMemo(() => {\n return basePriceTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [basePriceTypes]);\n\n useEffect(() => {\n getBasePriceTypes(selectedBase);\n }, [getBasePriceTypes, selectedBase]);\n\n const getClassifications = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setClassifications([]);\n return;\n }\n\n try {\n setIsLoadingClassifications(true);\n const { data: response } = await api.get('composition/classification', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const classificationsLoaded = response.data;\n setClassifications(classificationsLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingClassifications(false);\n }\n }, []);\n\n const classificationsToSelect = useMemo(() => {\n return classifications.map((classification) => ({\n value: String(classification.id),\n label: classification.description,\n }));\n }, [classifications]);\n\n useEffect(() => {\n getClassifications(selectedBase);\n }, [getClassifications, selectedBase]);\n\n const getClassificationTypes = useCallback(\n async (baseId: number | null, classificationId: number | null) => {\n if (!baseId) {\n setClassificationTypes([]);\n return;\n }\n\n try {\n setIsLoadingTypes(true);\n const { data: response } = await api.get('/composition/type', {\n params: {\n 'filter[base_id]': baseId,\n 'filter[classification_id]': classificationId,\n },\n });\n const classificationTypesLoaded = response.data;\n setClassificationTypes(classificationTypesLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as classes de composição dessa base!',\n status: 'error',\n });\n } finally {\n setIsLoadingTypes(false);\n }\n },\n [],\n );\n\n const classificationTypesToSelect = useMemo(() => {\n return classificationTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [classificationTypes]);\n\n useEffect(() => {\n getClassificationTypes(selectedBase, selectedClassification);\n }, [getClassificationTypes, selectedBase, selectedClassification]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n const clearBaseDependentValues = (): void => {\n setSelectedBaseVersion(null);\n setValue('version_id', null);\n\n setSelectedBaseLocale(null);\n setValue('locale_id', null);\n\n setSelectedBasePriceType(null);\n setValue('type_id', null);\n\n setSelectedClassification(null);\n setValue('classification_id', null);\n\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n };\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n clearBaseDependentValues();\n\n const value = selected ? Number(selected.value) : null;\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n\n setSelectedBase(value);\n setValue('base_id', value);\n };\n\n const handleClassificationChange = (selected: Selected): void => {\n setSelectedClassificationType(null);\n setValue('classification_type_id', null);\n\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassification(value);\n setValue('classification_id', value);\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isLoading={isLoadingBases}\n isDisabled={isLoadingBases || basesToSelect.length === 0}\n isClearable\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n (\n Number(s.value) === selectedBaseVersion,\n )}\n isLoading={isLoadingBaseVersions}\n isDisabled={\n isLoadingBaseVersions || baseVersionsToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseVersion(value);\n setValue('version_id', value);\n\n if (value && errors.version_id) {\n clearErrors('version_id');\n }\n }}\n />\n )}\n name=\"version_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n (\n Number(s.value) === selectedBaseLocale,\n )}\n isLoading={isLoadingBaseLocales}\n isDisabled={\n isLoadingBaseLocales || baseLocalesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseLocale(value);\n setValue('locale_id', value);\n\n if (value && errors.locale_id) {\n clearErrors('locale_id');\n }\n }}\n />\n )}\n name=\"locale_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo de preço\n\n (\n Number(s.value) === selectedBasePriceType,\n )}\n isLoading={isLoadingPriceTypes}\n isDisabled={\n isLoadingPriceTypes || basePriceTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBasePriceType(value);\n setValue('type_id', value);\n\n if (value && errors.type_id) {\n clearErrors('type_id');\n }\n }}\n />\n )}\n name=\"type_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n \n\n \n \n Classe da composição\n\n (\n Number(s.value) === selectedClassification,\n )}\n isLoading={isLoadingClassifications}\n isDisabled={\n isLoadingClassifications ||\n classificationsToSelect.length === 0\n }\n isClearable\n onChange={handleClassificationChange}\n />\n )}\n name=\"classification_id\"\n control={control}\n />\n \n\n \n Tipo da composição\n\n (\n Number(s.value) === selectedClassificationType,\n )}\n isLoading={isLoadingTypes}\n isDisabled={\n isLoadingTypes || classificationTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedClassificationType(value);\n setValue('classification_type_id', value);\n }}\n />\n )}\n name=\"classification_type_id\"\n control={control}\n />\n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da composição\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n IconButton,\n Input,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport {\n Composition,\n State,\n DefaultPrice,\n StatePrice,\n} from 'types/composition';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ntype ModalCompositionSelect = ModalRootProps & {\n data: {\n composition_id: string;\n };\n};\n\ntype SelectedComposition = Composition & {\n quantity: number | undefined;\n price_type_id: number | undefined;\n};\n\nexport type CompositionParam = {\n composition_id: string;\n price_type_id: number;\n coefficient: number;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\ntype ElasticSort = {\n 'sort[field]': string;\n 'sort[mode]': 'asc' | 'desc';\n};\n\nconst ModalBudgetCompositionSelect: React.FC = ({\n handleClose,\n onConfirm,\n data: { composition_id },\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [compositions, setCompositions] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedCompositions, setSelectedCompositions] = useState<\n SelectedComposition[]\n >([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.type_id) {\n Object.assign(validFilter, { 'filter[price_type_id]': filter.type_id });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (composition: Composition): number => {\n const price = getStatePrice(composition);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback((sortString: string | null): ElasticSort => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n }, []);\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setCompositions([]);\n\n try {\n const response = await api.get('/composition', {\n params: {\n 'filter[resource]': 'composition',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const compositionsData = response.data;\n\n const newPagination = {\n last_page: compositionsData.meta\n ? compositionsData.meta.last_page\n : compositionsData.last_page,\n };\n\n setCompositions(compositionsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n setCompositions([]);\n setServicePagination({ last_page: 1 });\n\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao pesquisar as composições. Tente novamente mais tarde!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectComposition = (item: Composition): void => {\n setSelectedCompositions((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n price_type_id: searchFilter.type_id ? searchFilter.type_id : undefined,\n },\n ]);\n };\n\n const handleDeleteComposition = (item: Composition): void => {\n setSelectedCompositions((selected) =>\n selected.filter((c) => c._id !== item._id),\n );\n };\n\n const getStatePrice = (composition: Composition): State => {\n if (!composition._source.prices)\n return {\n default: {\n total: 0,\n },\n } as State;\n\n const states = Array.from(Object.keys(composition._source.prices));\n const state = states[0];\n\n return composition._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedComposition[]): CompositionParam[] => {\n return selected.map((item) => ({\n composition_id: item._id,\n coefficient: item.quantity || 0,\n price_type_id: item.price_type_id || 0,\n }));\n },\n [],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n const preparedComponents = prepareComponents(selectedCompositions);\n\n await api.post(`/composition/${composition_id}/component/fragment`, {\n fragments: preparedComponents,\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar as composições selecionadas.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedCompositions,\n prepareComponents,\n handleClose,\n onConfirm,\n composition_id,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar composições\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isDisabled={\n (activeTab === 1 && selectedCompositions.length === 0) ||\n selectedCompositions.some(\n (item) => item.price_type_id === undefined,\n ) ||\n loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedCompositions.length > 0 && (\n \n {selectedCompositions.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(filter)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectComposition(item)}\n disabled={selectedCompositions.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedCompositions.some(\n (c) => c._id === item._id,\n )\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedCompositions.some(\n (c) => c._id === item._id,\n ) && (\n }\n onClick={() => handleDeleteComposition(item)}\n />\n )}\n \n ),\n active: selectedCompositions.some(\n (c) => c._id === item._id,\n ),\n })}\n data={compositions}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedCompositions.length > 0 ? (\n selectedCompositions.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhuma composição selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedCompositions((selected) =>\n selected.map((composition) =>\n composition._id === item._id\n ? {\n ...composition,\n quantity: v.floatValue,\n }\n : composition,\n ),\n );\n }}\n customInput={Input}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteComposition(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalBudgetCompositionSelect;\n","import React, {\n useCallback,\n useMemo,\n useState,\n useEffect,\n useContext,\n} from 'react';\nimport { Controller, useForm } from 'react-hook-form';\n\nimport { Filter as FilterIcon } from '@styled-icons/fa-solid/Filter';\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Button,\n Icon,\n Grid,\n FormControl,\n FormLabel,\n Flex,\n FormErrorMessage,\n Input,\n} from '@chakra-ui/react';\n\nimport OwnSelect from 'components/OwnSelect';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Base, Version, Locale, UnitMeasure, PriceTypes } from 'types/base';\n\ninterface Qs {\n [key: string]: string | number | null | undefined;\n}\n\nexport interface FilterHandles {\n open: () => void;\n}\n\nexport interface FilterData extends Qs {\n base_id: number | null;\n version_id: number | null;\n locale_id: number | null;\n type_id: number | null;\n unit_measure_id: number | null;\n description: string;\n}\n\ninterface FormProps {\n onSubmit(data: FilterData): void;\n loading?: boolean;\n}\n\nconst OWN_BASE_KEY_PREFIX = 'own.';\n\nconst SearchFilter: React.FC = ({ onSubmit, loading = false }) => {\n const { user } = useContext(AuthContext);\n\n const {\n handleSubmit,\n setValue,\n formState: { errors },\n control,\n register,\n clearErrors,\n } = useForm();\n\n const [bases, setBases] = useState([]);\n const [selectedBase, setSelectedBase] = useState(null);\n const [isLoadingBases, setIsLoadingBases] = useState(false);\n\n const selectedBaseObj = useMemo(\n () => bases.find((b) => b.id === Number(selectedBase)),\n [bases, selectedBase],\n );\n\n const [baseVersions, setBaseVersions] = useState([]);\n const [selectedBaseVersion, setSelectedBaseVersion] = useState(\n null,\n );\n const [isLoadingBaseVersions, setIsLoadingBaseVersions] = useState(false);\n\n const [baseLocales, setBaseLocales] = useState([]);\n const [selectedBaseLocale, setSelectedBaseLocale] = useState(\n null,\n );\n const [isLoadingBaseLocales, setIsLoadingBaseLocales] = useState(false);\n\n const [basePriceTypes, setBasePriceTypes] = useState([]);\n const [selectedBasePriceType, setSelectedBasePriceType] = useState<\n number | null\n >(null);\n const [isLoadingPriceTypes, setIsLoadingPriceTypes] = useState(false);\n\n const [unitMeasures, setUnitMeasures] = useState([]);\n const [selectedUnitMeasure, setSelectedUnitMeasure] = useState(\n null,\n );\n const [isLoadingUnitMeasures, setIsLoadingUnitMeasures] = useState(false);\n\n const prepareSubmit = useCallback(\n (data) => {\n onSubmit({\n ...data,\n });\n },\n [onSubmit],\n );\n\n const getBases = useCallback(async () => {\n setIsLoadingBases(true);\n\n try {\n const { data: response } = await api.get('/base', {\n params: {\n 'filter[with_plan]': `.`,\n 'filter[organization_id]': user.managed_organization.organization.id,\n sort: 'description',\n },\n });\n const basesLoaded = response.data;\n setBases(basesLoaded);\n\n if (basesLoaded.length === 1) {\n const [base] = basesLoaded;\n setSelectedBase(base.id);\n setValue('base_id', base.id);\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao carregar as bases!',\n status: 'error',\n });\n } finally {\n setIsLoadingBases(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basesToSelect = useMemo(() => {\n return bases.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [bases]);\n\n useEffect(() => {\n getBases();\n }, [getBases]);\n\n const getBaseVersions = useCallback(\n async (baseId: number | null) => {\n if (!baseId) {\n setBaseVersions([]);\n return;\n }\n\n try {\n setIsLoadingBaseVersions(true);\n const { data: response } = await api.get('version', {\n params: {\n 'filter[base_id]': baseId,\n sort: selectedBaseObj?.key.startsWith(OWN_BASE_KEY_PREFIX)\n ? `-created_at`\n : `-pointer`,\n },\n });\n const baseVersionsLoaded = response.data;\n setBaseVersions(baseVersionsLoaded);\n\n if (baseVersionsLoaded.length === 1) {\n const [baseVersion] = baseVersionsLoaded;\n setSelectedBaseVersion(baseVersion.id);\n setValue('version_id', baseVersion.id);\n\n if (errors.version_id) {\n clearErrors('version_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as versões da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseVersions(false);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selectedBaseObj],\n );\n\n const baseVersionsToSelect = useMemo(() => {\n return baseVersions.map((base) => ({\n value: String(base.id),\n label: base.description,\n }));\n }, [baseVersions]);\n\n useEffect(() => {\n getBaseVersions(selectedBase);\n }, [getBaseVersions, selectedBase]);\n\n const getBaseLocales = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBaseLocales([]);\n return;\n }\n\n try {\n setIsLoadingBaseLocales(true);\n const { data: response } = await api.get('locale', {\n params: {\n 'filter[base_id]': baseId,\n sort: 'description',\n },\n });\n const baseLocalesLoaded = response.data;\n setBaseLocales(baseLocalesLoaded);\n\n if (baseLocalesLoaded.length === 1) {\n const [baseLocale] = baseLocalesLoaded;\n setSelectedBaseLocale(baseLocale.id);\n setValue('locale_id', baseLocale.id);\n\n if (errors.locale_id) {\n clearErrors('locale_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os estados da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingBaseLocales(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const baseLocalesToSelect = useMemo(() => {\n return baseLocales.map((locale) => ({\n value: String(locale.id),\n label: locale.description,\n }));\n }, [baseLocales]);\n\n useEffect(() => {\n getBaseLocales(selectedBase);\n }, [getBaseLocales, selectedBase]);\n\n const getBasePriceTypes = useCallback(async (baseId: number | null) => {\n if (!baseId) {\n setBasePriceTypes([]);\n return;\n }\n\n try {\n setIsLoadingPriceTypes(true);\n const { data: response } = await api.get('price/type', {\n params: {\n 'filter[base_id]': baseId,\n },\n });\n const basePriceTypesLoaded = response.data;\n setBasePriceTypes(basePriceTypesLoaded);\n\n if (basePriceTypesLoaded.length === 1) {\n const [basePriceType] = basePriceTypesLoaded;\n setSelectedBasePriceType(basePriceType.id);\n setValue('type_id', basePriceType.id);\n\n if (errors.type_id) {\n clearErrors('type_id');\n }\n }\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar os tipos de preço da base!',\n status: 'error',\n });\n } finally {\n setIsLoadingPriceTypes(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const basePriceTypesToSelect = useMemo(() => {\n return basePriceTypes.map((type) => ({\n value: String(type.id),\n label: type.description,\n }));\n }, [basePriceTypes]);\n\n useEffect(() => {\n getBasePriceTypes(selectedBase);\n }, [getBasePriceTypes, selectedBase]);\n\n const getUnitMeasures = useCallback(async () => {\n setIsLoadingUnitMeasures(true);\n\n try {\n const { data: response } = await api.get('/unit/measure/list');\n const unitMeasuresLoaded = response.data;\n setUnitMeasures(unitMeasuresLoaded);\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao carregar as unidades de medida!',\n status: 'error',\n });\n } finally {\n setIsLoadingUnitMeasures(false);\n }\n }, []);\n\n const unitMeasuresToSelect = useMemo(() => {\n return unitMeasures.map((unitMeasure) => ({\n value: String(unitMeasure.id),\n label: unitMeasure.description,\n }));\n }, [unitMeasures]);\n\n useEffect(() => {\n getUnitMeasures();\n }, [getUnitMeasures]);\n\n const clearBaseDependentValues = (): void => {\n setSelectedBaseVersion(null);\n setValue('version_id', null);\n\n setSelectedBaseLocale(null);\n setValue('locale_id', null);\n\n setSelectedBasePriceType(null);\n setValue('type_id', null);\n };\n\n type Selected = { value: string } | null;\n const handleBaseChange = (selected: Selected): void => {\n clearBaseDependentValues();\n\n const value = selected ? Number(selected.value) : null;\n\n if (errors.base_id) {\n clearErrors('base_id');\n }\n\n setSelectedBase(value);\n setValue('base_id', value);\n };\n\n const submitForm = (): void => {\n handleSubmit(prepareSubmit)();\n };\n\n return (\n *': {\n marginY: 1,\n },\n }}\n onSubmit={handleSubmit(prepareSubmit)}\n >\n \n \n Base de dados\n\n (\n Number(s.value) === selectedBase,\n )}\n isLoading={isLoadingBases}\n isDisabled={isLoadingBases || basesToSelect.length === 0}\n isClearable\n onChange={handleBaseChange}\n />\n )}\n name=\"base_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.base_id && 'Base é obrigatória.'}\n \n \n\n \n Referência\n\n (\n Number(s.value) === selectedBaseVersion,\n )}\n isLoading={isLoadingBaseVersions}\n isDisabled={\n isLoadingBaseVersions || baseVersionsToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseVersion(value);\n setValue('version_id', value);\n\n if (value && errors.version_id) {\n clearErrors('version_id');\n }\n }}\n />\n )}\n name=\"version_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.version_id && 'Referência é obrigatória.'}\n \n \n\n \n Estado\n\n (\n Number(s.value) === selectedBaseLocale,\n )}\n isLoading={isLoadingBaseLocales}\n isDisabled={\n isLoadingBaseLocales || baseLocalesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBaseLocale(value);\n setValue('locale_id', value);\n\n if (value && errors.locale_id) {\n clearErrors('locale_id');\n }\n }}\n />\n )}\n name=\"locale_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.locale_id && 'Estado é obrigatório.'}\n \n \n\n \n Tipo\n\n (\n Number(s.value) === selectedBasePriceType,\n )}\n isLoading={isLoadingPriceTypes}\n isDisabled={\n isLoadingPriceTypes || basePriceTypesToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedBasePriceType(value);\n setValue('type_id', value);\n\n if (value && errors.type_id) {\n clearErrors('type_id');\n }\n }}\n />\n )}\n name=\"type_id\"\n control={control}\n rules={{ required: true }}\n />\n\n \n {errors.type_id && 'Tipo é obrigatório.'}\n \n \n\n \n Unidade de medida\n\n (\n Number(s.value) === selectedUnitMeasure,\n )}\n isLoading={isLoadingUnitMeasures}\n isDisabled={\n isLoadingUnitMeasures || unitMeasuresToSelect.length === 0\n }\n isClearable\n onChange={(selected) => {\n const value = selected ? Number(selected.value) : null;\n\n setSelectedUnitMeasure(value);\n setValue('unit_measure_id', value);\n }}\n />\n )}\n name=\"unit_measure_id\"\n control={control}\n />\n \n \n\n \n \n Pesquisar por descrição / código da insumo\n \n \n \n\n }\n onClick={submitForm}\n mt=\"4\"\n mb=\"4\"\n >\n Filtrar\n \n \n );\n};\n\nexport default SearchFilter;\n","import React, {\n Suspense,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport InputNumberFormat from 'react-number-format';\n\nimport { ArrowRight as ArrowRightIcon } from '@styled-icons/bootstrap/ArrowRight';\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { TrashAlt as TrashAltIcon } from '@styled-icons/boxicons-solid/TrashAlt';\nimport { Close as CloseIcon } from '@styled-icons/evaicons-solid/Close';\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Tabs,\n TabList,\n Tab,\n TabPanels,\n TabPanel,\n Button,\n Icon,\n Input as ChakraInput,\n Text,\n Box,\n TableContainer,\n useMediaQuery,\n HStack,\n Select,\n IconButton,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport Loader from 'components/Loader';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\nimport { Table, Tbody, Td, Th, Thead, Tr } from 'components/Table';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Input, State, DefaultPrice, StatePrice } from 'types/input';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport SearchFilter, { FilterData } from './SearchFilter';\n\ntype ModalInputSelect = ModalRootProps & {\n data: {\n composition_id: string;\n };\n};\n\ntype SelectedInput = Input & {\n quantity: number | undefined;\n price_type_id: number | undefined;\n};\n\nexport type InputParam = {\n input_id: string;\n coefficient: number;\n price_type_id: number;\n};\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nfunction isDefaultPrice(price: StatePrice): price is DefaultPrice {\n return 'default' in price;\n}\n\ntype ElasticSort = {\n 'sort[field]': string;\n 'sort[mode]': 'asc' | 'desc';\n};\n\nconst ModalOwnInputSelect: React.FC = ({\n handleClose,\n onConfirm,\n data: { composition_id },\n ...restProps\n}) => {\n const [activeTab, setActiveTab] = useState(0);\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [inputs, setInputs] = useState([]);\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [searchFilter, setSearchFilter] = useState({} as FilterData);\n const [sort, setSort] = useState('description');\n\n const hasRequiredFilters = useMemo(() => {\n return (\n !!searchFilter.base_id &&\n !!searchFilter.version_id &&\n !!searchFilter.locale_id &&\n !!searchFilter.type_id\n );\n }, [\n searchFilter.base_id,\n searchFilter.version_id,\n searchFilter.locale_id,\n searchFilter.type_id,\n ]);\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const [selectedInputs, setSelectedInputs] = useState([]);\n\n const [loading, setLoading] = useState(false);\n\n const handleTabsChange = (index: number): void => {\n setActiveTab(index);\n };\n\n const processFilters = useCallback((filter: FilterData) => {\n const validFilter = {};\n\n if (filter.description) {\n Object.assign(validFilter, { 'filter[keyword]': filter.description });\n }\n\n if (filter.base_id) {\n Object.assign(validFilter, { 'filter[base_id]': filter.base_id });\n }\n\n if (filter.version_id) {\n Object.assign(validFilter, { 'filter[version_id]': filter.version_id });\n }\n\n if (filter.locale_id) {\n Object.assign(validFilter, { 'filter[locale_id]': filter.locale_id });\n }\n\n if (filter.type_id) {\n Object.assign(validFilter, { 'filter[price_type_id]': filter.type_id });\n }\n\n if (filter.classification_id) {\n Object.assign(validFilter, {\n 'filter[classification_id]': filter.classification_id,\n });\n }\n\n if (filter.classification_type_id) {\n Object.assign(validFilter, {\n 'filter[type_id]': filter.classification_type_id,\n });\n }\n\n if (filter.unit_measure_id) {\n Object.assign(validFilter, {\n 'filter[unit_measure_id]': filter.unit_measure_id,\n });\n }\n\n return validFilter;\n }, []);\n\n const getPrice = (input: Input): number => {\n const price = getStatePrice(input);\n\n if (isDefaultPrice(price)) {\n return price.default.total;\n }\n\n if (price.taxed) {\n return price.taxed.total;\n }\n\n if (price.untaxed) {\n return price.untaxed.total;\n }\n\n return 0;\n };\n\n const processSort = useCallback((sortString: string | null): ElasticSort => {\n if (!sortString) return Object.create({});\n\n const isDesc = sortString.startsWith('-');\n const field = isDesc ? sortString.slice(1) : sortString;\n const mode = isDesc ? 'desc' : 'asc';\n\n return { 'sort[field]': field, 'sort[mode]': mode };\n }, []);\n\n const getData = useCallback(async () => {\n if (!hasRequiredFilters) return;\n\n setLoading(true);\n setInputs([]);\n\n try {\n const response = await api.get('/input', {\n params: {\n 'filter[resource]': 'input',\n ...processFilters(searchFilter),\n ...processSort(sort),\n page: pagination.page,\n per_page: pagination.per_page,\n },\n });\n\n const inputsData = response.data;\n\n const newPagination = {\n last_page: inputsData.meta\n ? inputsData.meta.last_page\n : inputsData.last_page,\n };\n\n setInputs(inputsData.data);\n setServicePagination(newPagination);\n } catch (err) {\n setInputs([]);\n setServicePagination({ last_page: 1 });\n\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao pesquisar os insumos. Tente novamente mais tarde!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n }, [\n pagination,\n searchFilter,\n processSort,\n processFilters,\n sort,\n hasRequiredFilters,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleSelectInput = (item: Input): void => {\n setSelectedInputs((prepared) => [\n ...prepared,\n {\n ...item,\n quantity: 1,\n price_type_id: searchFilter.type_id ? searchFilter.type_id : undefined,\n },\n ]);\n };\n\n const handleDeleteInput = (item: Input): void => {\n setSelectedInputs((selected) => selected.filter((c) => c._id !== item._id));\n };\n\n const getStatePrice = (input: Input): State => {\n if (!input._source.prices) {\n return {\n default: {\n total: 0,\n },\n } as State;\n }\n\n const states = Array.from(Object.keys(input._source.prices));\n const state = states[0];\n\n return input._source.prices[state];\n };\n\n const prepareComponents = useCallback(\n (selected: SelectedInput[]): InputParam[] => {\n return selected.map((item) => ({\n input_id: item._id,\n coefficient: item.quantity || 0,\n price_type_id: item.price_type_id || 0,\n }));\n },\n [],\n );\n\n const handleSubmitComponents = useCallback(async () => {\n setLoading(true);\n\n try {\n const preparedComponents = prepareComponents(selectedInputs);\n\n await api.post(`/composition/${composition_id}/component/fragment`, {\n fragments: preparedComponents,\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao salvar os insumos selecionados.',\n status: 'error',\n });\n }\n } finally {\n setLoading(false);\n }\n }, [\n selectedInputs,\n prepareComponents,\n handleClose,\n onConfirm,\n composition_id,\n ]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar insumos\n\n \n\n {!isMobile && (\n : undefined\n }\n leftIcon={activeTab === 1 ? : undefined}\n isDisabled={\n (activeTab === 1 && selectedInputs.length === 0) ||\n selectedInputs.some((item) => item.price_type_id === undefined) ||\n loading\n }\n onClick={() => {\n if (activeTab === 0) {\n setActiveTab(1);\n } else {\n handleSubmitComponents();\n }\n }}\n >\n {activeTab === 0 ? 'Avançar' : 'Salvar'}\n \n )}\n\n \n \n \n Pesquisar\n \n Selecionadas{' '}\n {selectedInputs.length > 0 && (\n \n {selectedInputs.length}\n \n )}\n \n \n\n }>\n \n \n setSearchFilter(filter)}\n loading={loading}\n />\n\n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n ({\n id: item._id,\n code: item._source.code,\n description: (\n \n {item._source.description}\n \n ),\n unit_measure: item._source.unit_measure.description,\n prices: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item)),\n actions: (\n \n }\n onClick={() => handleSelectInput(item)}\n disabled={selectedInputs.some(\n (c) => c._id === item._id,\n )}\n >\n {selectedInputs.some((c) => c._id === item._id)\n ? 'Selecionado'\n : 'Selecionar'}\n \n\n {selectedInputs.some((c) => c._id === item._id) && (\n }\n onClick={() => handleDeleteInput(item)}\n />\n )}\n \n ),\n active: selectedInputs.some((c) => c._id === item._id),\n })}\n data={inputs}\n loading={loading}\n initialSort={sort}\n onUpdateSort={(s) => setSort(s)}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {selectedInputs.length > 0 ? (\n selectedInputs.map((item, i) => (\n \n \n \n \n \n \n \n \n ))\n ) : (\n \n \n Nenhum insumo selecionada\n \n \n )}\n \n
CódigoDescriçãoUnidadeQuantidadeValor unitárioAções
{item._source.code}\n \n {item._source.description}\n \n \n {item._source.unit_measure.description}\n \n {\n setSelectedInputs((selected) =>\n selected.map((input) =>\n input._id === item._id\n ? {\n ...input,\n quantity: v.floatValue,\n }\n : input,\n ),\n );\n }}\n customInput={ChakraInput}\n />\n \n {Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(getPrice(item))}\n \n }\n onClick={() => handleDeleteInput(item)}\n >\n Remover\n \n
\n
\n\n {isMobile && (\n }\n onClick={handleSubmitComponents}\n mt=\"4\"\n >\n Salvar\n \n )}\n
\n
\n
\n \n
\n \n
\n );\n};\n\nexport default ModalOwnInputSelect;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\ntype Props = {\n description: string;\n color: string;\n};\n\nconst FlowStatusBadge: React.FC = ({ color, description }: Props) => {\n return (\n \n {description || 'Não definido'}\n \n );\n};\n\nexport default FlowStatusBadge;\n","import React, { useCallback, useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Text,\n Grid,\n HStack,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { ParametricBudget } from 'types/budget/parametric-budget';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport FlowStatusBadge from './StatusBadge';\n\ninterface ModalParametricBudgetHistoryProps extends ModalRootProps {\n data: {\n budget: ParametricBudget;\n };\n}\n\ntype FlowHistory = {\n id: number;\n type: string;\n user: {\n id: number;\n name: string;\n email: string;\n profile_verified: true;\n corporate_name: null;\n fantasy_name: null;\n document_type: null;\n document: null;\n address: null;\n number: null;\n complement: null;\n district: null;\n zip_code: null;\n city: null;\n created_at: string;\n updated_at: string;\n deleted_at: null;\n };\n object: {\n status: {\n color: string;\n icon: string;\n name: string;\n };\n };\n status: {\n color: string;\n icon: string;\n name: string;\n };\n message: string;\n created_at: string;\n updated_at: string;\n};\n\ntype FlowUser = FlowHistory['user'];\n\nconst modalMargin = 120;\nconst modalMobileFix = 100;\n\nconst ModalParametricBudgetHistory: React.FC =\n ({ handleClose, data: budgetData, ...restProps }) => {\n const { budget } = budgetData;\n\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 20,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] =\n useState({ last_page: 1 });\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get('/flow/history', {\n params: {\n 'filter[object_id]': budget.id,\n 'filter[object_type]': 'parametric_budget',\n page: pagination.page,\n per_page: pagination.per_page,\n sort: '-created_at',\n },\n });\n\n const history = response.data;\n\n const newPagination = {\n last_page: history.meta.last_page,\n };\n\n setData(history.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [pagination, budget]);\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const handleConfirm = (): void => {\n handleClose();\n };\n\n const getUserName = (item: FlowUser): string => {\n if (item.document_type === 'cnpj') {\n return `${item.corporate_name} - ${item.fantasy_name}`;\n }\n\n return item.name;\n };\n\n type Organization = ParametricBudget['organization'];\n const getOrganizationName = (organization: Organization): JSX.Element => {\n if (organization.document_type === 'cnpj') {\n return (\n <>\n {organization.fantasy_name}\n
\n {organization.corporate_name}\n \n );\n }\n\n return <>{organization.name};\n };\n\n return (\n \n \n \n Histórico de aprovação\n\n \n\n \n \n \n Descrição: \n \n {budget.build_description || 'Não especificado'}\n \n \n\n \n Status atual: \n \n {budget.flow_status?.name || 'Não especificado'}\n \n \n\n \n Criação: \n \n {formatDate(budget.created_at)}\n \n \n\n <>\n \n Organização: \n {getOrganizationName(budget.organization)}\n \n \n \n\n ({\n id: item.id,\n responsible: (\n <>\n {formatDate(item.created_at)}\n\n \n {getUserName(item.user)}\n \n \n ),\n status: (\n \n ),\n message: {item.message},\n actions: null,\n })}\n data={data}\n noDataMessage=\"Nenhuma ação registrada.\"\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n\n \n \n \n Fechar\n \n \n \n \n \n );\n };\n\nexport default ModalParametricBudgetHistory;\n","import React, { memo } from 'react';\n\nimport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverHeader,\n PopoverBody,\n PopoverArrow,\n PopoverCloseButton,\n PopoverProps,\n Text,\n Box,\n} from '@chakra-ui/react';\n\ninterface Props extends PopoverProps {\n description: string;\n}\n\nconst BuildingDetailsPopover: React.FC = ({ description, ...rest }) => {\n return (\n \n \n \n {description?.substr(0, 30) || '-'}\n {description?.length > 30 && '...'}\n \n \n\n \n \n DESCRIÇÃO DA OBRA\n \n\n \n \n\n \n {description ? (\n \n ) : (\n '-'\n )}\n \n \n \n );\n};\n\nexport default memo(BuildingDetailsPopover);\n","export const typeMap = {\n single_family_residence: 'R1 (Residência Unifamiliar)',\n affordable_housing_pp: 'PP (Prédio Popular)',\n multi_family_residence_r8: 'R8 (Residência Multifamiliar)',\n multi_family_residence_r16: 'R16 (Residência Multifamiliar)',\n social_interest_project: 'PIS (Projeto de Interesse Social)',\n affordable_housing_rp1q: 'RP1Q (Residência Popular)',\n commercial_open_floors: 'CAL8 (Comercial Andares Livre)',\n commercial_offices_and_stores_csl8: 'CSL8 (Comercial Salas e Lojas)',\n commercial_offices_and_stores_csl16: 'CSL16 (Comercial Salas e Lojas)',\n industrial_warehouse: 'GI (Galpão Industrial)',\n};\n\nexport const patternMap = {\n 'single_family_residence:low': 'R1-B (Baixo)',\n 'single_family_residence:normal': 'R1-N (Normal)',\n 'single_family_residence:high': 'R1-A (Alto)',\n 'affordable_housing_pp:low': 'PP-4B (Baixo)',\n 'affordable_housing_pp:normal': 'PP-4N (Normal)',\n 'multi_family_residence_r8:low': 'R8-B (Baixo)',\n 'multi_family_residence_r8:normal': 'R8-N (Normal)',\n 'multi_family_residence_r8:high': 'R8-A (Alto)',\n 'multi_family_residence_r16:normal': 'R16-N (Normal)',\n 'multi_family_residence_r16:high': 'R16-A (Alto)',\n social_interest_project: 'PIS (Projeto de Interesse Social)',\n affordable_housing_rp1q: 'RP1Q (Residência Popular)',\n 'commercial_open_floors:normal': 'CAL8-N (Normal)',\n 'commercial_open_floors:high': 'CAL8-A (Alto)',\n 'commercial_offices_and_stores_csl8:normal': 'CSL8-N (Normal)',\n 'commercial_offices_and_stores_csl8:high': 'CSL8-A (Alto)',\n 'commercial_offices_and_stores_csl16:normal': 'CSL16-N (Normal)',\n 'commercial_offices_and_stores_csl16:high': 'CSL16-A (Alto)',\n industrial_warehouse: 'GI (Galpão Industrial)',\n};\n","import React, { useState, useEffect, useCallback } from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalCloseButton,\n ModalBody,\n SimpleGrid,\n HStack,\n Flex,\n Input,\n Select,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport useDebouncedState from 'hooks/useDebouncedState';\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { ParametricBudget } from 'types/budget/parametric-budget';\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nimport BuildingDescriptionPopover from './BuildingDescriptionPopover';\nimport { typeMap, patternMap } from './shared';\n\nconst ModalParametricBudgetLookup: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [keyword, setKeyword] = useDebouncedState('');\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 5,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n try {\n const response = await api.get('/parametric/budget', {\n params: {\n 'filter[keyword]': keyword,\n page: pagination.page,\n per_page: pagination.per_page,\n sort: '-created_at',\n },\n });\n\n const parametricBudgets = response.data;\n\n const newPagination = {\n last_page: parametricBudgets.meta.last_page,\n };\n\n setData(parametricBudgets.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [keyword, pagination]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n type Organization = ParametricBudget['organization'];\n const getOrganizationName = (organization: Organization): JSX.Element => {\n if (organization.document_type === 'cnpj') {\n return (\n \n {organization.fantasy_name\n ? organization.fantasy_name\n : organization.corporate_name}\n \n );\n }\n\n return <>{organization.name};\n };\n\n const getBuildTypeDescription = (buildType: string): string => {\n return typeMap[buildType as keyof typeof typeMap] || 'Não definido';\n };\n\n const getPatternDescription = (\n buildType: string,\n pattern: string | undefined,\n ): string => {\n let key = buildType;\n if (pattern) {\n key = `${buildType}:${pattern}`;\n }\n return patternMap[key as keyof typeof patternMap] || 'Não definido';\n };\n\n const handleConfirm = (parametricBudget: ParametricBudget): void => {\n if (onConfirm) onConfirm(parametricBudget);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n return (\n \n \n \n Selecionar orçamento paramétrico\n\n \n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n setKeyword(e.target.value)}\n mb={{ base: 3, md: 0 }}\n />\n \n \n\n ({\n id: item.id,\n created_at: (\n <>\n {formatDate(item.created_at)}\n {!!item.organization && (\n \n {getOrganizationName(item.organization)}\n \n )}\n \n ),\n build_description: (\n \n ),\n build_type: (\n <>\n \n {getBuildTypeDescription(item.build_type)}\n \n\n \n {getPatternDescription(item.build_type, item.build_pattern)}\n {item.state && ` - ${item.state.name}`}\n \n \n ),\n total_cost: Intl.NumberFormat('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n }).format(item.total_cost),\n actions: (\n handleConfirm(item)}\n leftIcon={}\n >\n Selecionar\n \n ),\n })}\n data={data}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n \n );\n};\n\nexport default ModalParametricBudgetLookup;\n","import React, { useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n FormErrorMessage,\n Text,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalPositionUpdateProps extends ModalRootProps {\n data: {\n budget_id: number;\n item_id: number;\n code: string;\n description: string;\n position: string;\n };\n}\n\nconst ModalPositionUpdate: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const [position, setPosition] = useState();\n const positionRef = React.useRef(null);\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (positionRef.current) {\n positionRef.current.focus();\n }\n }, []);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!position) {\n Object.assign(formErrors, { position: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n await api.put(\n `/budget/${data.budget_id}/component/${data.item_id}/move`,\n {\n location: String(position),\n },\n );\n\n if (onConfirm) onConfirm();\n\n toast({\n description: 'Componente movido com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message || 'Houve um erro ao mover o componente!',\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n Alterar posição\n\n \n\n \n \n Código\n {data.code}\n \n\n \n Descrição\n {data.description}\n \n\n \n Posição atual\n {data.position}\n \n\n \n Nova posição\n\n setPosition(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n Nova posição é obrigatória\n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalPositionUpdate;\n","import React, { useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n Textarea,\n FormControl,\n FormLabel,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalStageAddProps extends ModalRootProps {\n data: {\n budget_id: number;\n parent_stage_id: number | null;\n stage_id?: number;\n title?: string;\n description?: string;\n quantity?: number;\n type?: string;\n composition_price_id?: number;\n input_price_id?: number;\n };\n}\n\nconst ModalStageAdd: React.FC = ({\n onConfirm,\n handleClose,\n data,\n mode,\n ...restProps\n}) => {\n const [initialLoad, setInitialLoad] = useState(false);\n\n const [title, setTitle] = useState(data.title || '');\n const titleRef = React.useRef(null);\n\n const [description, setDescription] = useState(\n data.description || '',\n );\n\n const [quantity, setQuantity] = useState(data.quantity || 1);\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (!initialLoad) {\n setInitialLoad(true);\n }\n }, [initialLoad]);\n\n useEffect(() => {\n if (initialLoad && titleRef.current) {\n titleRef.current.focus();\n }\n }, [initialLoad]);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!title) {\n Object.assign(formErrors, { title: true, type: 'required' });\n }\n\n if (!quantity || quantity <= 0) {\n Object.assign(formErrors, { quantity: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n if (mode === 'add') {\n await api.post(`/budget/${data.budget_id}/component`, {\n parent_stage_id: data.parent_stage_id,\n components: [\n {\n type: 'stage',\n title,\n description,\n quantity,\n },\n ],\n });\n } else if (mode === 'edit') {\n await api.put(`/budget/${data.budget_id}/component/${data.stage_id}`, {\n ...(data.type?.includes('composition')\n ? {\n type: 'composition_original',\n component: {\n composition_price_id: data.composition_price_id,\n quantity,\n },\n }\n : {}),\n ...(data.type?.includes('input')\n ? {\n type: 'input_original',\n component: {\n input_price_id: data.input_price_id,\n quantity,\n },\n }\n : {}),\n ...(data.type?.includes('stage')\n ? {\n type: 'stage',\n component: {\n title,\n quantity,\n description,\n },\n }\n : {}),\n });\n }\n\n if (onConfirm) onConfirm();\n\n toast({\n description:\n mode === 'add'\n ? 'Item adicionado com sucesso!'\n : 'Item editado com sucesso!',\n status: 'success',\n });\n\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n (mode === 'add'\n ? 'Houve um erro ao adicionar o item!'\n : 'Houve um erro ao editar o item!'),\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {mode === 'add' ? 'Adicionar item' : 'Editar item'}\n \n\n \n\n \n \n Título\n\n setTitle(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.title && 'Título é obrigatório'}\n \n \n\n \n Quantidade\n\n setQuantity(e.target.valueAsNumber)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.quantity && 'Quantidade é obrigatória'}\n \n \n\n {data.type?.includes('stage') && (\n \n Descrição\n\n setDescription(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n \n )}\n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalStageAdd;\n","import React from 'react';\n\nimport StatusCircle from 'components/StatusCircle';\n\nimport { Subscription } from 'types/access-control';\n\nexport const getStatusBadge = (\n item: Subscription['histories']['0'],\n): React.ReactElement => {\n if (item.status === 'approved') {\n return Aprovado;\n }\n\n if (item.status === 'delayed') {\n return Em atraso;\n }\n\n if (item.status === 'chargeback') {\n return Chargeback;\n }\n\n if (item.status === 'refunded') {\n return Recusado;\n }\n\n return Outro;\n};\n","import React from 'react';\n\nimport { formatDate } from 'shared/date';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n HStack,\n useMediaQuery,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport { Subscription } from 'types/access-control';\n\nimport { getPaymentMethod } from './getPaymentMethod';\nimport { getStatusBadge } from './getStatusBadge';\n\ninterface ModalSubscriptionHistoryProps extends ModalRootProps {\n data: {\n histories: Subscription['histories'];\n };\n}\n\nconst modalMargin = 300;\nconst modalMobileFix = modalMargin - 20;\n\nconst ModalSubscriptionHistory: React.FC = ({\n handleClose,\n data: { histories },\n ...restProps\n}) => {\n const [isMobile] = useMediaQuery('(max-width: 728px)');\n\n const handleConfirm = (): void => {\n handleClose();\n };\n\n const reversedHistories = [...histories].reverse();\n\n return (\n \n \n \n Histórico da transação\n\n \n\n \n ({\n id: item.id,\n transaction_id: item.transaction_id,\n created_at: formatDate(item.created_at),\n status: getStatusBadge(item),\n payment_method: getPaymentMethod(item.payment_method),\n actions: null,\n })}\n data={reversedHistories}\n noDataMessage=\"Nenhuma ação registrada.\"\n loading={false}\n onUpdateSort={() => {\n //\n }}\n />\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ModalSubscriptionHistory;\n","export const getPaymentMethod = (paymentMethod: string): string => {\n if (paymentMethod === 'credit_card') {\n return 'Cartão de crédito';\n }\n\n if (paymentMethod === 'bankin_ticket') {\n return 'Boleto';\n }\n\n if (paymentMethod === 'pix') {\n return 'Pix';\n }\n\n return 'Não identificado';\n};\n","import React from 'react';\n\nimport { Whatsapp as WhatsAppIcon } from '@styled-icons/boxicons-logos/Whatsapp';\nimport { Mail as MailIcon } from '@styled-icons/fluentui-system-filled/Mail';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Flex,\n Grid,\n HStack,\n Heading,\n Box,\n Icon,\n Link,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nconst ModalSupport: React.FC = ({\n handleClose,\n ...restProps\n}) => {\n return (\n \n \n \n Suporte ecustos\n\n \n\n \n \n Fale com a gente\n \n\n *': {\n marginY: 1,\n },\n }}\n >\n \n \n \n \n +55 48 3027-8104\n \n \n\n \n \n \n suporte@ecustos.com.br\n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ModalSupport;\n","import ModalABCValues from 'components/Modal/ABCValues';\nimport ModalBaseAdd from 'components/Modal/BaseAdd';\nimport ModalBaseSelect from 'components/Modal/BaseSelect';\nimport ModalBudgetComponentObservation from 'components/Modal/BudgetComponentObservation';\nimport ModalBudgetCompositionEdit from 'components/Modal/BudgetCompositionEdit';\nimport ModalBudgetCompositionFragmentSelect from 'components/Modal/BudgetCompositionFragmentSelect';\nimport ModalBudgetCompositionLookup from 'components/Modal/BudgetCompositionLookup';\nimport ModalBudgetCompositionSelect from 'components/Modal/BudgetCompositionSelect';\nimport ModalBudgetCustomCompositionAdd from 'components/Modal/BudgetCustomCompositionAdd';\nimport ModalBudgetGlobalPriceChange from 'components/Modal/BudgetGlobalPriceChange';\nimport ModalBudgetHistory from 'components/Modal/BudgetHistory';\nimport ModalBudgetInputFragmentSelect from 'components/Modal/BudgetInputFragmentSelect';\nimport ModalBudgetInputSelect from 'components/Modal/BudgetInputSelect';\nimport ModalBudgetOutdatedComponentSelect from 'components/Modal/BudgetOutdatedComponentSelect';\nimport ModalClientLookup from 'components/Modal/ClientLookup';\nimport ModalClientSelfLookup from 'components/Modal/ClientSelfLookup';\nimport ModalCompositionLookup from 'components/Modal/CompositionLookup';\nimport ModalCompositionPricesLookup from 'components/Modal/CompositionPriceLookup';\nimport ModalGPTModel from 'components/Modal/GPTModel';\nimport ModalImport from 'components/Modal/Import';\nimport ModalImportCompositionFields from 'components/Modal/Import/Composition/Fields';\nimport ModalImportCompositionOverview from 'components/Modal/Import/Composition/Overview';\nimport ModalImportInputFields from 'components/Modal/Import/Input/Fields';\nimport ModalImportInputOverview from 'components/Modal/Import/Input/Overview';\nimport ModalInputPricesLookup from 'components/Modal/InputPriceLookup';\nimport ModalLocaleAndPriceTypeSelect from 'components/Modal/LocaleAndPriceTypeSelect';\nimport ModalManageFlow from 'components/Modal/ManageFlow';\nimport ModalManageParametricFlow from 'components/Modal/ManageParametricFlow';\nimport ModalOwnCompositionSelect from 'components/Modal/OwnCompositionSelect';\nimport ModalOwnInputSelect from 'components/Modal/OwnInputSelect';\nimport ModalParametricBudgetHistory from 'components/Modal/ParametricBudgetHistory';\nimport ModalParametricBudgetLookup from 'components/Modal/ParametricBudgetLookup';\nimport ModalPositionUpdate from 'components/Modal/PositionUpdate';\nimport ModalStageAdd from 'components/Modal/StageAdd';\nimport ModalSubscriptionHistory from 'components/Modal/SubscriptionHistory';\nimport ModalSupport from 'components/Modal/Support';\nimport ModalUserInvite from 'components/Modal/UserInvite';\nimport ModalUserOrganizationLookup from 'components/Modal/UserOrganizationLookup';\nimport ModalVersionAdd from 'components/Modal/VersionAdd';\n\nexport default {\n baseAdd: ModalBaseAdd,\n baseSelect: ModalBaseSelect,\n versionAdd: ModalVersionAdd,\n clientLookup: ModalClientLookup,\n clientSelfLookup: ModalClientSelfLookup,\n compositionLookup: ModalCompositionLookup,\n budgetCompositionLookup: ModalBudgetCompositionLookup,\n compositionPriceLookup: ModalCompositionPricesLookup,\n inputPriceLookup: ModalInputPricesLookup,\n userInvite: ModalUserInvite,\n budgetCompositionSelect: ModalBudgetCompositionSelect,\n budgetCompositionFragmentSelect: ModalBudgetCompositionFragmentSelect,\n budgetComponentObservation: ModalBudgetComponentObservation,\n budgetInputSelect: ModalBudgetInputSelect,\n budgetInputFragmentSelect: ModalBudgetInputFragmentSelect,\n stageAdd: ModalStageAdd,\n positionUpdate: ModalPositionUpdate,\n ownCompositionSelect: ModalOwnCompositionSelect,\n ownInputSelect: ModalOwnInputSelect,\n import: ModalImport,\n inputImportFields: ModalImportInputFields,\n compositionImportFields: ModalImportCompositionFields,\n importInputOverview: ModalImportInputOverview,\n importCompositionOverview: ModalImportCompositionOverview,\n budgetCompositionEdit: ModalBudgetCompositionEdit,\n subscriptionHistory: ModalSubscriptionHistory,\n userOrganizationLookup: ModalUserOrganizationLookup,\n abcValues: ModalABCValues,\n support: ModalSupport,\n flowChange: ModalManageFlow,\n budgetHistory: ModalBudgetHistory,\n parametricFlowChange: ModalManageParametricFlow,\n parametricBudgetHistory: ModalParametricBudgetHistory,\n gptModel: ModalGPTModel,\n parametricBudgetLookup: ModalParametricBudgetLookup,\n budgetCustomCompositionAdd: ModalBudgetCustomCompositionAdd,\n budgetOutdatedComponentSelect: ModalBudgetOutdatedComponentSelect,\n localeAndPriceTypeSelect: ModalLocaleAndPriceTypeSelect,\n budgetGlobalPriceChange: ModalBudgetGlobalPriceChange,\n};\n","import React, { useEffect, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { toast } from 'shared/toast';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalVersionAddProps extends ModalRootProps {\n data: {\n base_id?: number;\n version_id?: number;\n description?: string;\n reference?: string;\n };\n}\n\nconst ModalVersionAdd: React.FC = ({\n onConfirm,\n handleClose,\n data = {},\n mode,\n ...restProps\n}) => {\n const [description, setDescription] = useState(\n data.description || '',\n );\n const [referenceMonth] = useState(data.reference || '');\n\n const descriptionRef = React.useRef(null);\n // const referenceMonthRef = React.useRef(null);\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n useEffect(() => {\n if (descriptionRef.current) {\n descriptionRef.current.focus();\n }\n }, []);\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!description) {\n Object.assign(formErrors, { description: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n const [year, month] = referenceMonth.split('-');\n const yearNum = Number(year);\n const monthNum = Number(month);\n\n try {\n setLoading(true);\n if (mode === 'add') {\n await api.post(`/version`, {\n base_id: data.base_id,\n description,\n ...(!!referenceMonth && { month: monthNum, year: yearNum }),\n });\n } else if (mode === 'edit') {\n await api.put(`/version/${data.version_id}`, {\n base_id: data.base_id,\n description,\n ...(!!referenceMonth && { month: monthNum, year: yearNum }),\n });\n }\n if (onConfirm) onConfirm();\n toast({\n description:\n mode === 'add'\n ? 'Referência adicionada com sucesso!'\n : 'Referência editada com sucesso!',\n status: 'success',\n });\n handleClose();\n } catch (err) {\n toast({\n description:\n err.response?.data?.message ||\n (mode === 'add'\n ? 'Houve um erro ao adicionar a referência!'\n : 'Houve um erro ao editar a referência!'),\n status: 'error',\n });\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {mode === 'add' ? 'Adicionar referência' : 'Editar referência'}\n \n\n \n\n \n \n Descrição\n\n setDescription(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.description && 'Descrição é obrigatória'}\n \n \n {/*\n \n Mês/Ano\n\n setReferenceMonth(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.reference && 'Referência é obrigatória'}\n \n */}\n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalVersionAdd;\n","import React, { useContext, useState } from 'react';\n\nimport { api } from 'services/api';\nimport { isAxiosError } from 'services/axios';\nimport { toast } from 'shared/toast';\nimport * as yup from 'yup';\n\nimport { ChevronDownIcon } from '@chakra-ui/icons';\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalBody,\n ModalCloseButton,\n Button,\n ModalFooter,\n Input,\n FormControl,\n FormLabel,\n Menu,\n MenuButton,\n MenuItem,\n MenuList,\n MenuDivider,\n FormErrorMessage,\n} from '@chakra-ui/react';\n\nimport { ModalRootProps } from 'components/Modal/Root';\n\nimport AuthContext from 'contexts/AuthContext';\n\ntype FormErrors = {\n [key: string]: string | boolean;\n type: 'invalid' | 'required';\n};\n\ninterface ModalUserInviteProps extends ModalRootProps {\n data: {\n group_id: number | null;\n };\n}\n\nconst ModalUserInvite: React.FC = ({\n onConfirm,\n handleClose,\n data,\n ...restProps\n}) => {\n const { user } = useContext(AuthContext);\n\n const emailValidator = yup.string().email();\n\n const { group_id } = data;\n\n const [email, setEmail] = useState();\n const [role, setRole] = useState(() =>\n group_id ? 'group-admin' : '',\n );\n\n const [loading, setLoading] = useState(false);\n\n const [errors, setErrors] = useState();\n\n const roleDescriptionByKey = (key: string): string => {\n switch (key) {\n case 'organization-admin':\n case 'group-admin':\n return 'Administrador';\n\n case 'organization-user':\n return 'Gestor';\n\n default:\n return key;\n }\n };\n\n const handleConfirm = async (): Promise => {\n const formErrors: FormErrors = {} as FormErrors;\n\n if (!email) {\n Object.assign(formErrors, { email: true, type: 'required' });\n }\n\n if (!(await emailValidator.isValid(email))) {\n Object.assign(formErrors, { email: true, type: 'invalid' });\n }\n\n if (!role) {\n Object.assign(formErrors, { role: true, type: 'required' });\n }\n\n setErrors(formErrors);\n if (Object.keys(formErrors).length) {\n return;\n }\n\n try {\n setLoading(true);\n\n await api.post(\n `/organization/${user.managed_organization.organization.id}/user`,\n {\n email,\n role,\n group_id: group_id || null,\n organization_id: user.managed_organization.organization.id,\n },\n );\n\n toast({\n description: `Foi enviado um e-mail com o convite para ${email}.`,\n status: 'success',\n });\n\n if (onConfirm) onConfirm();\n handleClose();\n } catch (err) {\n if (isAxiosError(err)) {\n if (err.response?.data.message.includes('already exists')) {\n toast({\n description: 'Usuário já existe!',\n status: 'error',\n });\n } else {\n toast({\n description:\n err.response?.data?.message ||\n 'Houve um erro ao tentar enviar o e-mail. Verifique se o endereço está correto e tente novamente.',\n status: 'error',\n });\n }\n }\n } finally {\n setLoading(false);\n }\n };\n\n return (\n \n \n \n \n {group_id ? 'Adicionar usuário da construtora' : 'Adicionar usuário'}\n \n\n \n\n \n \n E-mail\n setEmail(e.target.value)}\n onKeyPress={(e) => e.key === 'Enter' && handleConfirm()}\n />\n\n \n {!!errors?.email && errors?.type === 'invalid'\n ? 'E-mail inválido'\n : 'E-mail é obrigatório'}\n \n \n\n \n Permissão\n \n }\n size=\"md\"\n textAlign=\"left\"\n borderColor={errors?.role ? 'red.500' : 'unset'}\n color={errors?.role ? 'white.200' : 'unset'}\n bgColor={errors?.role ? 'red.200' : 'gray.200'}\n _hover={{\n bgColor: errors?.role ? 'red.200' : 'gray.200',\n }}\n _active={{\n bgColor: errors?.role ? 'red.200' : 'gray.200',\n }}\n >\n {role ? roleDescriptionByKey(role) : 'Selecione'}\n \n\n \n {!group_id && (\n <>\n {\n setRole('organization-admin');\n }}\n >\n Administrador Permissão para gerenciar todos os\n orçamentos, não consegue editar um orçamento ou fazer\n qualquer alteração, consegue criar novos usuários,\n consegue criar construtoras. Aplicar bloqueios de acessos.\n \n\n \n\n {\n setRole('organization-user');\n }}\n >\n Gestor Gerenciar os orçamentos, com aprovação e\n devolutivas. Não tem permissão para rotinas\n administrativas no sistemas ecustos.\n \n \n )}\n\n {!!group_id && (\n {\n setRole('group-admin');\n }}\n >\n Administrador Crie orçamentos e acompanhe o fluxo de\n aprovação.\n \n )}\n \n \n\n Permissão é obrigatória\n \n \n\n \n \n Salvar\n \n \n \n \n );\n};\n\nexport default ModalUserInvite;\n","import React, {\n useState,\n useEffect,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\n\nimport { Check as CheckIcon } from '@styled-icons/boxicons-regular/Check';\nimport { api } from 'services/api';\nimport { formatDate } from 'shared/date';\nimport { isSuperOrEcustosAdmin } from 'shared/roles';\n\nimport {\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalCloseButton,\n ModalBody,\n SimpleGrid,\n HStack,\n Flex,\n Input,\n Select,\n Button,\n Icon,\n Text,\n} from '@chakra-ui/react';\n\nimport AppTable from 'components/AppTable';\nimport { ModalRootProps } from 'components/Modal/Root';\nimport PaginationWrapper from 'components/Pagination';\n\nimport AuthContext from 'contexts/AuthContext';\n\nimport { Organization } from 'hooks/useAuth';\nimport useDebouncedState from 'hooks/useDebouncedState';\nimport useThrottledState from 'hooks/useThrottledState';\n\nimport { Pagination, ServicePagination } from 'types/pagination';\n\nconst ModalUserOrganizationLookup: React.FC = ({\n onConfirm,\n handleClose,\n ...restProps\n}) => {\n const { user, jwtManagement } = useContext(AuthContext);\n\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(false);\n\n const [keyword, setKeyword] = useDebouncedState('');\n const [pagination, setPagination] = useThrottledState(\n (() => {\n return {\n per_page: 10,\n page: 1,\n };\n })(),\n 1000,\n );\n\n const [servicePagination, setServicePagination] = useState(\n { last_page: 1 },\n );\n\n const getData = useCallback(async () => {\n setLoading(true);\n setData([]);\n\n const user_id = isSuperOrEcustosAdmin(user) ? undefined : user.id;\n\n try {\n const response = await api.get('/organization/user', {\n params: {\n 'filter[keyword]': keyword,\n 'filter[status]': 'active',\n page: pagination.page,\n per_page: pagination.per_page,\n 'filter[user_id]': user_id,\n },\n });\n\n const userOrganizations = response.data;\n\n const newPagination = {\n last_page: userOrganizations.meta.last_page,\n };\n\n setData(userOrganizations.data);\n setServicePagination(newPagination);\n } catch (err) {\n setData([]);\n setServicePagination({ last_page: 1 });\n } finally {\n setLoading(false);\n }\n }, [keyword, pagination, user]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n\n const getOrganizationName = ({ organization }: Organization): string => {\n if (organization.document_type === 'cnpj') {\n if (!organization.fantasy_name) {\n return organization.corporate_name;\n }\n\n return `${organization.corporate_name} - ${organization.fantasy_name}`;\n }\n\n return organization.name;\n };\n\n const getUserName = ({ user: u }: Organization): string => {\n if (u.document_type === 'cnpj') {\n if (!u.fantasy_name) {\n return u.corporate_name;\n }\n\n return `${u.corporate_name} - ${u.fantasy_name}`;\n }\n\n return u.name;\n };\n\n const handleConfirm = (organization: Organization): void => {\n if (onConfirm) onConfirm(organization);\n handleClose();\n };\n\n useEffect(() => {\n if (pagination.page > servicePagination?.last_page) {\n setPagination((oldPagination) => {\n if (oldPagination.page > 1) {\n return {\n ...oldPagination,\n page: 1,\n };\n }\n\n return oldPagination;\n });\n }\n }, [pagination.page, servicePagination, setPagination]);\n\n const canCloseModal = useMemo(() => {\n if (!user.managed_organization) {\n return false;\n }\n\n if (!jwtManagement) {\n return false;\n }\n\n return true;\n }, [user.managed_organization, jwtManagement]);\n\n return (\n \n \n \n Selecionar Organização\n\n {canCloseModal && }\n\n \n \n \n Por página:\n {\n setPagination({\n ...pagination,\n per_page: Number(e.target.value),\n });\n }}\n >\n {[5, 10, 20, 50, 100].map((item) => (\n \n ))}\n \n \n\n \n setKeyword(e.target.value)}\n mb={{ base: 3, md: 0 }}\n />\n \n \n\n ({\n id: item.id,\n name: (\n <>\n \n {getUserName(item)}\n \n {item.user.email}\n \n ),\n organization: (\n \n {getOrganizationName(item)}\n \n ),\n email_verified_at:\n item.user.email_verified_at &&\n formatDate(item.user.email_verified_at),\n actions: (\n }\n onClick={() => handleConfirm(item)}\n disabled={item.id === user.managed_organization?.id}\n >\n Selecionar\n \n ),\n })}\n data={data}\n loading={loading}\n onUpdateSort={() => {\n //\n }}\n />\n\n {\n setPagination({ ...pagination, page: selectedPage });\n }}\n />\n \n \n \n );\n};\n\nexport default ModalUserOrganizationLookup;\n","import React from 'react';\n\nimport { ModalProps as ChakraModalProps } from '@chakra-ui/react';\n\nimport useModal, { ModalProps } from 'hooks/useModal';\n\nimport modalList from './modalList';\n\ntype ChakraProps = Omit;\n\nexport interface ModalRootProps extends ModalProps, ChakraProps {\n handleClose: () => void;\n}\n\nexport type ModalKey = keyof typeof modalList;\n\nconst ModalRoot: React.FC = () => {\n const { modals, closeModal } = useModal();\n\n return (\n <>\n {modals.map(({ key, props }) => {\n const Component = modalList[key];\n\n if (!Component) return null;\n\n return (\n closeModal(key)}\n handleClose={() => closeModal(key)}\n closeOnOverlayClick={false}\n {...props}\n />\n );\n })}\n \n );\n};\n\nexport default ModalRoot;\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Badge: ComponentStyleConfig = {\n baseStyle: {\n fontSize: 10,\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Box: ComponentStyleConfig = {\n defaultProps: {\n boxShadow: '0px 0px 15px rgba(0, 0, 0, 0.1)',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Button: ComponentStyleConfig = {\n defaultProps: {\n size: 'sm',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const FormLabel: ComponentStyleConfig = {\n baseStyle: {\n fontSize: 'sm',\n _invalid: {\n color: 'red.500',\n },\n },\n};\n\nexport const FormError: ComponentStyleConfig = {\n baseStyle: {\n text: {\n color: 'red.500',\n mb: 3,\n },\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const IconButton: ComponentStyleConfig = {\n defaultProps: {\n isRound: true,\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Input: ComponentStyleConfig = {\n variants: {\n ecustos: {\n field: {\n background: '#FFF',\n color: 'blackAplha',\n borderWidth: 1,\n borderRadius: 5,\n borderColor: 'gray.300',\n errorBorderColor: 'red.300',\n transitionDuration: '100ms',\n _readOnly: {\n bg: `gray.100`,\n },\n _focus: {\n borderColor: 'blue.300',\n },\n _invalid: {\n borderColor: 'red.500',\n background: 'red.100',\n _placeholder: {\n color: 'red.600',\n },\n },\n },\n },\n },\n defaultProps: {\n size: 'md',\n variant: 'ecustos',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Select: ComponentStyleConfig = {\n baseStyle: {\n borderRadius: 6,\n },\n defaultProps: {\n size: 'md',\n variant: 'ecustos',\n },\n variants: {\n ecustos: {\n field: {\n background: '#FFF',\n color: 'blackAplha',\n borderWidth: 1,\n borderRadius: 5,\n borderColor: 'gray.300',\n transitionDuration: '100ms',\n _readOnly: {\n bg: `gray.100`,\n pointerEvents: 'none',\n touchAction: 'none',\n tabIndex: '-1',\n ariaDisabled: 'true',\n },\n _focus: {\n borderColor: 'blue.300',\n },\n _invalid: {\n borderColor: 'red.500',\n background: 'red.100',\n _placeholder: {\n color: 'red.600',\n },\n },\n },\n // addon: {\n // borderColor: '#0f9',\n // },\n },\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Table: ComponentStyleConfig = {\n defaultProps: {\n size: 'sm',\n variant: 'striped',\n },\n};\n\nexport const Td: ComponentStyleConfig = {\n baseStyle: {\n bg: 'gray.400',\n },\n};\n","import { ComponentStyleConfig } from '@chakra-ui/react';\n\nexport const Tooltip: ComponentStyleConfig = {\n baseStyle: {\n borderRadius: 6,\n padding: 2,\n },\n};\n","import { extendTheme } from '@chakra-ui/react';\n\nimport colors from './colors';\nimport * as components from './components';\nimport config from './config';\n\nconst styles = {\n global: {\n ':root': {\n fontSize: '15px',\n },\n 'html, body': {\n background: 'gray.50',\n },\n },\n};\n\nconst customTheme = extendTheme({\n config,\n colors,\n styles,\n fonts: {\n body: 'Inter, system-ui, sans-serif',\n heading: 'Inter, system-ui, sans-serif',\n mono: 'Menlo, monospace',\n },\n transition: {\n transitionTimingFunction: 'ease-in-out',\n transitionDuration: '200ms',\n },\n components: {\n ...components,\n },\n});\n\nexport default customTheme;\n","export default {\n brand: {\n 50: '#698b95',\n 100: '#507783',\n 200: '#376471',\n 300: '#1e5060',\n 400: '#053d4e',\n 500: '#053746',\n 600: '#04313e',\n 700: '#042b37',\n 800: '#03252f',\n 900: '#031f27 ',\n },\n go: {\n '50': '#edf0fb',\n '100': '#d4dbf5',\n '200': '#b3c1ef',\n '300': '#7e99e3',\n '400': '#4367d2',\n '500': '#24378d',\n '600': '#263078',\n '700': '#272b67',\n '800': '#242653',\n '900': '#222445',\n },\n purple: {\n 100: '#BD8BF0',\n 200: '#B77FEE',\n 300: '#B074ED',\n 400: '#AA68EB',\n 500: '#A55EEA',\n 600: '#9848E7',\n 700: '#8C33E5',\n 800: '#801FE2',\n 900: '#751BCE',\n },\n pink: {\n 100: '#F0758B',\n 200: '#EF6780',\n 300: '#EE5974',\n 400: '#EC4B69',\n 500: '#EB3B5A',\n 600: '#E92A4D',\n 700: '#E5183E',\n 800: '#D21639',\n 900: '#BF1433',\n },\n yellow: {\n 100: '#FEDE6A',\n 200: '#FEDB5C',\n 300: '#FED84D',\n 400: '#FED43E',\n 500: '#FED330',\n 600: '#FECC1A',\n 700: '#FEC804',\n 800: '#A78301',\n 900: '#896B01',\n },\n green: {\n 100: '#24FF7C',\n 200: '#0FFF6F',\n 300: '#00F863',\n 400: '#00E25A',\n 500: '#00CD52',\n 600: '#00BD4C',\n 700: '#00AF46',\n 800: '#005020',\n 900: '#00421A',\n },\n lime: {\n 50: '#f2ffde',\n 100: '#defcb2',\n 200: '#caf884',\n 300: '#b5f554',\n 400: '#a1f226',\n 500: '#88d90d',\n 600: '#69a905',\n 700: '#4a7801',\n 800: '#2b4800',\n 900: '#0b1900',\n },\n blue: {\n 100: '#4992FF',\n 200: '#3787FF',\n 300: '#247CFF',\n 400: '#1271FF',\n 500: '#0066FF',\n 600: '#0057DB',\n 700: '#0049B6',\n 800: '#003A92',\n 900: '#002C6D',\n },\n oceanBlue: {\n 100: '#CAF0F8',\n 200: '#ADE8F4',\n 300: '#90E0EF',\n 400: '#48CAE4',\n 500: '#00B4D8',\n 600: '#0096C7',\n 700: '#0077B6',\n 800: '#023E8A',\n 900: '#03045E',\n },\n gray: {\n // 50: '#F7FAFC',\n 50: '#F8F9FA',\n 100: '#E9ECEF',\n 200: '#DEE2E6',\n 300: '#CED4DA',\n 400: '#ADB5BD',\n 500: '#A5B1C2',\n 600: '#6C757D',\n 700: '#495057',\n 800: '#343A40',\n 900: '#212529',\n },\n indigo: {\n 50: '#eef2ff',\n 100: '#e0e7ff',\n 200: '#c7d2fe',\n 300: '#a5b4fc',\n 400: '#818cf8',\n 500: '#6366f1',\n 600: '#4f46e5',\n 700: '#4338ca',\n 800: '#3730a3',\n 900: '#312e81',\n },\n};\n","import React from 'react';\nimport { DndProvider } from 'react-dnd';\nimport { HTML5Backend } from 'react-dnd-html5-backend';\nimport { QueryClientProvider, QueryClient } from 'react-query';\nimport { ReactQueryDevtools } from 'react-query/devtools';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport Routes from 'routes';\n\nimport { ChakraProvider } from '@chakra-ui/react';\n\nimport AlertRoot from 'components/Alert/Root';\nimport ModalRoot from 'components/Modal/Root';\n\nimport { AlertProvider } from 'contexts/AlertContext';\nimport { AuthProvider } from 'contexts/AuthContext';\nimport { ModalProvider } from 'contexts/ModalContext';\n\nimport customTheme from 'styles/theme/customTheme';\n\nimport 'react-perfect-scrollbar/dist/css/styles.css';\n\nimport 'styles/css/all.scss';\n\nconst queryClient = new QueryClient();\n\nconst App: React.FC = () => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n );\n};\n\nexport default App;\n","import React from 'react'; // { Suspense, lazy }\nimport ReactDOM from 'react-dom';\n\nimport { ColorModeScript } from '@chakra-ui/react';\n\n// import FallbackSpinner from 'components/FallbackSpinner';\nimport App from './App';\n\n// const LazyApp = lazy(() => import('./App'));\n\nReactDOM.render(\n \n \n\n {/* }> */}\n \n {/* */}\n ,\n document.getElementById('root'),\n);\n","import { format } from 'date-fns';\nimport { utcToZonedTime } from 'date-fns-tz';\n\nexport function formatDate(date: string | Date): string {\n return format(new Date(date), 'dd/MM/yyyy HH:mm');\n}\n\nexport function toFilterFormat(date: string | Date): string {\n return format(utcToZonedTime(new Date(date), 'UTC'), 'yyyy-MM-dd HH:mm');\n}\n","import React from 'react';\n\nimport { Flex, Text, Box, keyframes } from '@chakra-ui/react';\n\ntype Size = 'xs' | 'x-small' | 'sm' | 'md' | 'lg';\ntype Weight = 'normal' | 'medium' | 'semibold' | 'bold';\n\ntype CenteredProps = {\n height: string;\n display: string;\n alignItems: string;\n justifyContent: string;\n};\n\ninterface StatusCircleProps {\n colorScheme: string;\n colorSchemeType?: 'manual' | 'chakra';\n children: string | React.ReactNode;\n hasCircle?: boolean;\n centered?: boolean;\n onClick?: () => void;\n title?: string;\n size?: Size;\n weight?: Weight;\n}\n\nconst spin = keyframes`\n 0% {opacity: 0; scale: 0;}\n 50% {opacity: 0.3; scale: 1;}\n 100% {opacity: 0; scale: 0;}\n`;\n\nconst StatusCircle: React.FC = ({\n colorScheme,\n colorSchemeType,\n children,\n hasCircle = true,\n centered = false,\n onClick,\n title,\n size = 'x-small',\n weight = 'bold',\n}) => {\n const spinAnimation = `${spin} infinite 2s ease`;\n\n const [color] = colorScheme.split('.');\n\n const getCenteredProps = (): CenteredProps => {\n return {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n };\n };\n\n return (\n \n {hasCircle && (\n \n )}\n \n {children}\n \n \n );\n};\n\nexport default StatusCircle;\n","import { createContext } from 'react';\n\nconst TableContext = createContext>({});\n\nexport default TableContext;\n","import React from 'react';\n\nimport { Table as ChakraTable, TableProps } from '@chakra-ui/react';\n\nimport TableContext from 'contexts/TableContext';\n\nexport const Table = (props: TableProps): React.ReactElement => {\n const { className, ...rest } = props;\n const classes = `${className || ''} table-responsible`;\n\n return (\n \n \n \n );\n};\n","import React from 'react';\n\nimport { TableBodyProps, Tbody as ChakraTbody } from '@chakra-ui/react';\n\nexport const Tbody = (props: TableBodyProps): React.ReactElement => (\n \n);\n","import React from 'react';\n\nimport { TableHeadProps, Thead as ChakraThead } from '@chakra-ui/react';\n\nexport const Thead = (props: TableHeadProps): React.ReactElement => {\n const { children, ...rest } = props;\n\n return (\n \n {React.isValidElement(children) &&\n React.cloneElement(children, { inHeader: true })}\n \n );\n};\n","import React from 'react';\n\nimport { TableCellProps, Td as ChakraTd } from '@chakra-ui/react';\n\nimport TableContext from 'contexts/TableContext';\n\ninterface ITdInnerProps extends TableCellProps {\n columnKey: number;\n narrowHeaders: Record;\n noData?: boolean;\n}\n\nexport type ITdProps = Omit;\n\nconst TdInner = ({\n className,\n children,\n ...restProps\n}: ITdInnerProps): React.ReactElement => {\n const {\n narrowHeaders = {},\n columnKey = 0,\n onClick,\n colSpan,\n ...rest\n } = restProps;\n\n const classes = !restProps?.noData ? className : '';\n const innerOnClick = !restProps?.noData ? onClick : undefined;\n\n return (\n \n {!restProps?.noData && colSpan !== 10 && (\n // eslint-disable-next-line\n \n {narrowHeaders[columnKey]}\n \n )}\n\n {children ??
 
}\n
\n );\n};\n\nexport const Td = (props: ITdProps): JSX.Element => (\n \n {(headers) => {\n return ;\n }}\n \n);\n","import React, { ReactElement } from 'react';\n\nimport { TableRowProps, Tr as ChakraTr } from '@chakra-ui/react';\n\nimport TableContext from 'contexts/TableContext';\n\ninterface ITrInnerProps extends TableRowProps {\n headers: Record;\n inHeader: boolean;\n}\n\nexport type ITrProps = Omit;\n\nconst TrInner = (props: ITrInnerProps): React.ReactElement => {\n const { headers, children, inHeader, ...rest } = props;\n\n if (headers && inHeader) {\n React.Children.map(props.children, (child, i) => {\n if (child) {\n headers[i] = (child as ReactElement).props.children;\n }\n });\n }\n\n const childProps = (idx: number): React.ReactElement =>\n inHeader ? { key: idx } : { key: idx, columnKey: idx };\n\n return (\n \n {children &&\n React.Children.map(\n children,\n (child, idx) =>\n React.isValidElement(child) &&\n React.cloneElement(child, childProps(idx)),\n )}\n \n );\n};\n\nexport const Tr = (props: ITrProps): React.ReactElement => (\n \n {(headers) => }\n \n);\n","import React from 'react';\n\nimport { TableColumnHeaderProps, Th as ChakraTh } from '@chakra-ui/react';\n\nexport const Th = (props: TableColumnHeaderProps): ChakraTh => (\n \n);\n","import { useContext } from 'react';\n\nimport ModalContext, { IModalContext } from 'contexts/ModalContext';\n\nfunction useModal(): IModalContext {\n const modal = useContext(ModalContext);\n\n if (!modal) {\n throw new Error('You have to use \"useModal()\" inside ModalProvider');\n }\n\n return modal;\n}\n\nexport type { ModalProps, IModalContext } from 'contexts/ModalContext';\n\nexport default useModal;\n","import React from 'react';\n\nimport { Grid, GridProps } from '@chakra-ui/react';\n\ninterface SummaryContainerProps extends GridProps {\n loading: boolean;\n}\n\nconst SummaryContainer = (props: SummaryContainerProps): React.ReactElement => {\n const { children, loading, ...rest } = props;\n\n return (\n \n {children &&\n React.Children.map(children, (child, idx) => {\n return (\n React.isValidElement(child) &&\n React.cloneElement(child, { idx, loading })\n );\n })}\n \n );\n};\n\nexport default SummaryContainer;\n"],"sourceRoot":""}