@erpsquad/common 1.10.74 → 1.10.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{android-12-switch-CXEiaZf0.js → android-12-switch-Cruc3J1J.js} +5 -5
- package/dist/chunks/{android-12-switch-CXEiaZf0.js.map → android-12-switch-Cruc3J1J.js.map} +1 -1
- package/dist/chunks/{android-12-switch-DOruO2DA.esm.js → android-12-switch-DPP00xjJ.esm.js} +4 -4
- package/dist/chunks/{android-12-switch-DOruO2DA.esm.js.map → android-12-switch-DPP00xjJ.esm.js.map} +1 -1
- package/dist/chunks/{appbar-ByiY9Ehc.esm.js → appbar-7puZelDZ.esm.js} +102 -3
- package/dist/chunks/appbar-7puZelDZ.esm.js.map +1 -0
- package/dist/chunks/{appbar-Cht2DM8y.js → appbar-DbazXkez.js} +102 -3
- package/dist/chunks/appbar-DbazXkez.js.map +1 -0
- package/dist/chunks/{default-data-AYPWIApH.js → default-data-B0Y8TU26.js} +5 -5
- package/dist/chunks/{default-data-AYPWIApH.js.map → default-data-B0Y8TU26.js.map} +1 -1
- package/dist/chunks/{default-data-BJi3OcW1.esm.js → default-data-DlPr1rYe.esm.js} +5 -5
- package/dist/chunks/{default-data-BJi3OcW1.esm.js.map → default-data-DlPr1rYe.esm.js.map} +1 -1
- package/dist/chunks/{fullScreen-BT9r6A8F.esm.js → fullScreen-B4ZPj9dr.esm.js} +2 -2
- package/dist/chunks/{fullScreen-BT9r6A8F.esm.js.map → fullScreen-B4ZPj9dr.esm.js.map} +1 -1
- package/dist/chunks/{fullScreen-C1yKeusg.js → fullScreen-BrdRBi-K.js} +2 -2
- package/dist/chunks/{fullScreen-C1yKeusg.js.map → fullScreen-BrdRBi-K.js.map} +1 -1
- package/dist/chunks/{radio-button-BYtmY0l-.js → radio-button-Bxl9UISl.js} +1 -18
- package/dist/chunks/radio-button-Bxl9UISl.js.map +1 -0
- package/dist/chunks/{radio-button-wgwiOmaZ.esm.js → radio-button-mbPNQ3rc.esm.js} +16 -33
- package/dist/chunks/radio-button-mbPNQ3rc.esm.js.map +1 -0
- package/dist/chunks/{sidebar-CG90JVRA.esm.js → sidebar-B6-JNM4K.esm.js} +3 -3
- package/dist/chunks/{sidebar-CG90JVRA.esm.js.map → sidebar-B6-JNM4K.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-CwqNppLF.js → sidebar-CBzmUNFw.js} +3 -3
- package/dist/chunks/{sidebar-CwqNppLF.js.map → sidebar-CBzmUNFw.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-C3OHGWsn.esm.js → sidebarScreen-C7gUqSYZ.esm.js} +3 -3
- package/dist/chunks/{sidebarScreen-C3OHGWsn.esm.js.map → sidebarScreen-C7gUqSYZ.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-DVwqG-Hi.js → sidebarScreen-vIzHgQxd.js} +3 -3
- package/dist/chunks/{sidebarScreen-DVwqG-Hi.js.map → sidebarScreen-vIzHgQxd.js.map} +1 -1
- package/dist/chunks/{tick-B4IAsV4W.js → tick-COMAwRR1.js} +18 -1
- package/dist/chunks/tick-COMAwRR1.js.map +1 -0
- package/dist/chunks/{tick-DUuDXLjB.esm.js → tick-DaxkNl7E.esm.js} +18 -1
- package/dist/chunks/tick-DaxkNl7E.esm.js.map +1 -0
- package/dist/chunks/{uom-field-wrapper-DalNHR65.esm.js → uom-field-wrapper-BnjRsGw2.esm.js} +6 -6
- package/dist/chunks/{uom-field-wrapper-DalNHR65.esm.js.map → uom-field-wrapper-BnjRsGw2.esm.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-DHhz5pod.js → uom-field-wrapper-aR0Kqbm9.js} +7 -7
- package/dist/chunks/{uom-field-wrapper-DHhz5pod.js.map → uom-field-wrapper-aR0Kqbm9.js.map} +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/action-bar/action-bar.d.ts +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/footer/footer.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/components/header/components/index.d.ts +1 -0
- package/dist/components/header/components/language-switch/index.d.ts +2 -0
- package/dist/components/header/components/language-switch/language-switch.d.ts +2 -0
- package/dist/components/icons/action-arrow.d.ts +3 -3
- package/dist/components/icons/add-circle.d.ts +3 -3
- package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/components/icons/arrow-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/components/icons/arrow-up.d.ts +3 -3
- package/dist/components/icons/assignments.d.ts +3 -3
- package/dist/components/icons/blank-circle.d.ts +3 -3
- package/dist/components/icons/block-filled.d.ts +3 -3
- package/dist/components/icons/calendar-add.d.ts +3 -3
- package/dist/components/icons/calendar.d.ts +3 -3
- package/dist/components/icons/checkbox-square.d.ts +3 -3
- package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/components/icons/clock.d.ts +3 -3
- package/dist/components/icons/close.d.ts +3 -3
- package/dist/components/icons/coin-outline.d.ts +3 -3
- package/dist/components/icons/copy.d.ts +3 -3
- package/dist/components/icons/coupon.d.ts +3 -3
- package/dist/components/icons/cross-hire.d.ts +3 -3
- package/dist/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/components/icons/dashboard.d.ts +3 -3
- package/dist/components/icons/document-download.d.ts +3 -3
- package/dist/components/icons/document.d.ts +3 -3
- package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/components/icons/dollar-circle.d.ts +3 -3
- package/dist/components/icons/edit.d.ts +3 -3
- package/dist/components/icons/email.d.ts +3 -3
- package/dist/components/icons/export.d.ts +3 -3
- package/dist/components/icons/eye-off.d.ts +3 -3
- package/dist/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/components/icons/eye.d.ts +3 -3
- package/dist/components/icons/filled-circle.d.ts +3 -3
- package/dist/components/icons/filter-remove.d.ts +3 -3
- package/dist/components/icons/filter.d.ts +3 -3
- package/dist/components/icons/folder-save.d.ts +3 -3
- package/dist/components/icons/grid.d.ts +3 -3
- package/dist/components/icons/hashtag.d.ts +3 -3
- package/dist/components/icons/image.d.ts +3 -3
- package/dist/components/icons/import.d.ts +3 -3
- package/dist/components/icons/info-circle.d.ts +3 -3
- package/dist/components/icons/info.d.ts +3 -3
- package/dist/components/icons/link-horizontal.d.ts +3 -3
- package/dist/components/icons/link.d.ts +3 -3
- package/dist/components/icons/location.d.ts +3 -3
- package/dist/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/components/icons/lowest-price.d.ts +3 -3
- package/dist/components/icons/more.d.ts +3 -3
- package/dist/components/icons/notification.d.ts +3 -3
- package/dist/components/icons/paper-clip.d.ts +3 -3
- package/dist/components/icons/paragraph.d.ts +3 -3
- package/dist/components/icons/payment-request.d.ts +3 -3
- package/dist/components/icons/phone.d.ts +3 -3
- package/dist/components/icons/printer.d.ts +3 -3
- package/dist/components/icons/process-calendar.d.ts +3 -3
- package/dist/components/icons/promotion.d.ts +3 -3
- package/dist/components/icons/radio-button.d.ts +3 -3
- package/dist/components/icons/receipt-filled.d.ts +3 -3
- package/dist/components/icons/receipt-outline.d.ts +3 -3
- package/dist/components/icons/receipt.d.ts +3 -3
- package/dist/components/icons/refresh-icon.d.ts +3 -3
- package/dist/components/icons/replace.d.ts +3 -3
- package/dist/components/icons/save.d.ts +3 -3
- package/dist/components/icons/search-status.d.ts +3 -3
- package/dist/components/icons/search.d.ts +3 -3
- package/dist/components/icons/settings-fallback.d.ts +3 -3
- package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/components/icons/stacked-layer.d.ts +3 -3
- package/dist/components/icons/start-filled.d.ts +3 -3
- package/dist/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/components/icons/tick-circle.d.ts +3 -3
- package/dist/components/icons/tick-octagon.d.ts +3 -3
- package/dist/components/icons/tick.d.ts +3 -3
- package/dist/components/icons/toggle-switch.d.ts +3 -3
- package/dist/components/icons/trash.d.ts +3 -3
- package/dist/components/icons/wave.d.ts +3 -3
- package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/components/icons/work-centre.d.ts +3 -3
- package/dist/components/index.esm.js +28 -28
- package/dist/components/index.js +12 -12
- package/dist/components/location-select.d.ts +1 -1
- package/dist/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/components/material-table/material-table.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/switches/android-12-switch.d.ts +1 -3
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/upload-media/upload-media.d.ts +1 -1
- package/dist/icons/index.esm.js +26 -26
- package/dist/icons/index.js +8 -8
- package/dist/index.esm.js +46 -46
- package/dist/index.js +15 -15
- package/dist/layout/index.esm.js +2 -2
- package/dist/layout/index.js +2 -2
- package/dist/src/components/accordion/accordion.d.ts +1 -1
- package/dist/src/components/action-bar/action-bar.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +1 -1
- package/dist/src/components/footer/footer.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/src/components/header/components/index.d.ts +1 -0
- package/dist/src/components/header/components/language-switch/index.d.ts +2 -0
- package/dist/src/components/header/components/language-switch/language-switch.d.ts +2 -0
- package/dist/src/components/icons/action-arrow.d.ts +3 -3
- package/dist/src/components/icons/add-circle.d.ts +3 -3
- package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/src/components/icons/arrow-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/src/components/icons/arrow-up.d.ts +3 -3
- package/dist/src/components/icons/assignments.d.ts +3 -3
- package/dist/src/components/icons/blank-circle.d.ts +3 -3
- package/dist/src/components/icons/block-filled.d.ts +3 -3
- package/dist/src/components/icons/calendar-add.d.ts +3 -3
- package/dist/src/components/icons/calendar.d.ts +3 -3
- package/dist/src/components/icons/checkbox-square.d.ts +3 -3
- package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/src/components/icons/clock.d.ts +3 -3
- package/dist/src/components/icons/close.d.ts +3 -3
- package/dist/src/components/icons/coin-outline.d.ts +3 -3
- package/dist/src/components/icons/copy.d.ts +3 -3
- package/dist/src/components/icons/coupon.d.ts +3 -3
- package/dist/src/components/icons/cross-hire.d.ts +3 -3
- package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/src/components/icons/dashboard.d.ts +3 -3
- package/dist/src/components/icons/document-download.d.ts +3 -3
- package/dist/src/components/icons/document.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle.d.ts +3 -3
- package/dist/src/components/icons/edit.d.ts +3 -3
- package/dist/src/components/icons/email.d.ts +3 -3
- package/dist/src/components/icons/export.d.ts +3 -3
- package/dist/src/components/icons/eye-off.d.ts +3 -3
- package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/src/components/icons/eye.d.ts +3 -3
- package/dist/src/components/icons/filled-circle.d.ts +3 -3
- package/dist/src/components/icons/filter-remove.d.ts +3 -3
- package/dist/src/components/icons/filter.d.ts +3 -3
- package/dist/src/components/icons/folder-save.d.ts +3 -3
- package/dist/src/components/icons/grid.d.ts +3 -3
- package/dist/src/components/icons/hashtag.d.ts +3 -3
- package/dist/src/components/icons/image.d.ts +3 -3
- package/dist/src/components/icons/import.d.ts +3 -3
- package/dist/src/components/icons/info-circle.d.ts +3 -3
- package/dist/src/components/icons/info.d.ts +3 -3
- package/dist/src/components/icons/link-horizontal.d.ts +3 -3
- package/dist/src/components/icons/link.d.ts +3 -3
- package/dist/src/components/icons/location.d.ts +3 -3
- package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/src/components/icons/lowest-price.d.ts +3 -3
- package/dist/src/components/icons/more.d.ts +3 -3
- package/dist/src/components/icons/notification.d.ts +3 -3
- package/dist/src/components/icons/paper-clip.d.ts +3 -3
- package/dist/src/components/icons/paragraph.d.ts +3 -3
- package/dist/src/components/icons/payment-request.d.ts +3 -3
- package/dist/src/components/icons/phone.d.ts +3 -3
- package/dist/src/components/icons/printer.d.ts +3 -3
- package/dist/src/components/icons/process-calendar.d.ts +3 -3
- package/dist/src/components/icons/promotion.d.ts +3 -3
- package/dist/src/components/icons/radio-button.d.ts +3 -3
- package/dist/src/components/icons/receipt-filled.d.ts +3 -3
- package/dist/src/components/icons/receipt-outline.d.ts +3 -3
- package/dist/src/components/icons/receipt.d.ts +3 -3
- package/dist/src/components/icons/refresh-icon.d.ts +3 -3
- package/dist/src/components/icons/replace.d.ts +3 -3
- package/dist/src/components/icons/save.d.ts +3 -3
- package/dist/src/components/icons/search-status.d.ts +3 -3
- package/dist/src/components/icons/search.d.ts +3 -3
- package/dist/src/components/icons/settings-fallback.d.ts +3 -3
- package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/src/components/icons/stacked-layer.d.ts +3 -3
- package/dist/src/components/icons/start-filled.d.ts +3 -3
- package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/tick-circle.d.ts +3 -3
- package/dist/src/components/icons/tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/tick.d.ts +3 -3
- package/dist/src/components/icons/toggle-switch.d.ts +3 -3
- package/dist/src/components/icons/trash.d.ts +3 -3
- package/dist/src/components/icons/wave.d.ts +3 -3
- package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/work-centre.d.ts +3 -3
- package/dist/src/components/location-select.d.ts +1 -1
- package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/src/components/material-table/material-table.d.ts +1 -1
- package/dist/src/components/phone-input/phone-input.d.ts +1 -1
- package/dist/src/components/radio/radio.d.ts +1 -1
- package/dist/src/components/select/select.d.ts +1 -1
- package/dist/src/components/switches/android-12-switch.d.ts +1 -3
- package/dist/src/components/text-field/text-field.d.ts +1 -1
- package/dist/src/components/time-picker/time-picker.d.ts +1 -1
- package/dist/src/components/upload-media/upload-media.d.ts +1 -1
- package/dist/src/utils/common-utility.d.ts +2 -2
- package/dist/style.css +43 -0
- package/dist/utils/common-utility.d.ts +2 -2
- package/dist/views/index.esm.js +5 -5
- package/dist/views/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/appbar-ByiY9Ehc.esm.js.map +0 -1
- package/dist/chunks/appbar-Cht2DM8y.js.map +0 -1
- package/dist/chunks/radio-button-BYtmY0l-.js.map +0 -1
- package/dist/chunks/radio-button-wgwiOmaZ.esm.js.map +0 -1
- package/dist/chunks/tick-B4IAsV4W.js.map +0 -1
- package/dist/chunks/tick-DUuDXLjB.esm.js.map +0 -1
|
@@ -8,7 +8,7 @@ import { at as getToken, b0 as getV1DepartmentsId, aK as removeSeriesFromTitle,
|
|
|
8
8
|
import { aN as setAiFeatureBaseUrl, bh as uploadDocument, bi as getDocumentStatus, bj as streamV1CopilotChat, bk as startV1CopilotAgent, bl as formAssistV1Copilot, bm as resetV1CopilotSession, bn as getV1ChartOfAccountId, bo as getV1TaxCodeId, bp as getV1InventoryItemsId, aC as getV1Uom, aV as getV1PartiesId, bq as getV1PaymentTermsId, br as getV1CompanyId, bs as getV1CurrencyId, aa as getV1LocationsStates, bt as getV1WarehouseLocationId, bu as postV1AiFeatureSearchQuery, bv as getV1Notification, bw as getV1NotificationMarkAllAsRead, bx as patchV1NotificationMarkAsReadId } from "./api-z4kM0HGD.esm.js";
|
|
9
9
|
import { Add, OpenInFullRounded, Close, UploadFileRounded, DeleteOutlineRounded, ArrowUpwardRounded, PictureAsPdfRounded, CloudUploadRounded, CheckCircleRounded, ErrorRounded, HourglassBottomRounded, Person, CheckCircle, Warning, Email, Assignment, HourglassEmpty, Cancel, AccountBalance } from "@mui/icons-material";
|
|
10
10
|
import { B as Button } from "./button-CiFUSruA.esm.js";
|
|
11
|
-
import { S as Save, b as SearchStatus, a as Search, T as Tick, E as EyeOff } from "./tick-
|
|
11
|
+
import { S as Save, b as SearchStatus, a as Search, A as ArrowDown, T as Tick, E as EyeOff } from "./tick-DaxkNl7E.esm.js";
|
|
12
12
|
import { P as PropTypes, _ as _extends, e as _objectWithoutPropertiesLoose, x as styled, v as styleFunctionSx, T as THEME_ID, d as defaultTheme$1, k as interopRequireDefaultExports, g as generateUtilityClass, u as useDefaultProps, j as capitalize, f as alpha_1, C as ClassNameGenerator, a as createTheme } from "./identifier-0SZUhw_A.esm.js";
|
|
13
13
|
import { debounce } from "lodash";
|
|
14
14
|
import { styled as styled$1, Dialog, TextField as TextField$1, InputAdornment, IconButton, Tooltip as Tooltip$1, DialogTitle, Box as Box$1, Divider as Divider$1, DialogContent, DialogActions, CircularProgress, Snackbar, Alert, Avatar as Avatar$1, SvgIcon, Badge, Menu as Menu$1, Skeleton, MenuItem as MenuItem$1, ListItemAvatar, ListItemText as ListItemText$1 } from "@mui/material";
|
|
@@ -25,11 +25,11 @@ import * as ReactDOM from "react-dom";
|
|
|
25
25
|
import ReactDOM__default from "react-dom";
|
|
26
26
|
import { enqueueSnackbar } from "notistack";
|
|
27
27
|
import { u as useLanguage } from "./useLangauge-dxTIlPe-.esm.js";
|
|
28
|
+
import { keyframes } from "@emotion/react";
|
|
28
29
|
import { Controller, appendErrors, useForm } from "react-hook-form";
|
|
29
30
|
import { validateFieldsNatively, toNestErrors } from "@hookform/resolvers";
|
|
30
31
|
import * as Yup from "yup";
|
|
31
32
|
import { E as Eye } from "./eye-PU88lR34.esm.js";
|
|
32
|
-
import { keyframes } from "@emotion/react";
|
|
33
33
|
function chainPropTypes(propType1, propType2) {
|
|
34
34
|
if (process.env.NODE_ENV === "production") {
|
|
35
35
|
return () => null;
|
|
@@ -8848,6 +8848,104 @@ function GlobalSearch() {
|
|
|
8848
8848
|
] })
|
|
8849
8849
|
] });
|
|
8850
8850
|
}
|
|
8851
|
+
const createEnglishFallback = () => ({
|
|
8852
|
+
code: "en",
|
|
8853
|
+
label: "English",
|
|
8854
|
+
direction: "ltr"
|
|
8855
|
+
});
|
|
8856
|
+
function LanguageSwitch() {
|
|
8857
|
+
const { t } = useTranslation();
|
|
8858
|
+
const {
|
|
8859
|
+
languages,
|
|
8860
|
+
currentLanguage,
|
|
8861
|
+
changeLanguage,
|
|
8862
|
+
isLoading,
|
|
8863
|
+
error: languageContextError,
|
|
8864
|
+
isFallbackActive,
|
|
8865
|
+
fetchLanguages
|
|
8866
|
+
} = useLanguage();
|
|
8867
|
+
const [localLanguageError, setLocalLanguageError] = useState(null);
|
|
8868
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
8869
|
+
const isMenuOpen = Boolean(anchorEl);
|
|
8870
|
+
const handleMenuOpen = (event) => setAnchorEl(event.currentTarget);
|
|
8871
|
+
const handleMenuClose = () => setAnchorEl(null);
|
|
8872
|
+
const getLanguagesForDropdown = () => {
|
|
8873
|
+
if (!languages || languages.length === 0) {
|
|
8874
|
+
return [createEnglishFallback()];
|
|
8875
|
+
}
|
|
8876
|
+
const hasEnglish = languages.some((lang) => lang.code === "en");
|
|
8877
|
+
if (!hasEnglish) {
|
|
8878
|
+
return [createEnglishFallback(), ...languages];
|
|
8879
|
+
}
|
|
8880
|
+
return languages;
|
|
8881
|
+
};
|
|
8882
|
+
const getCurrentLanguageDisplay = () => {
|
|
8883
|
+
if (!currentLanguage) return "EN";
|
|
8884
|
+
return currentLanguage.code.toUpperCase();
|
|
8885
|
+
};
|
|
8886
|
+
const onChangeLang = (lang_code) => {
|
|
8887
|
+
setLocalLanguageError(null);
|
|
8888
|
+
handleMenuClose();
|
|
8889
|
+
if (!languages || languages.length === 0) {
|
|
8890
|
+
const errorMsg = t("header.language_not_available") || "Languages not available";
|
|
8891
|
+
setLocalLanguageError(errorMsg);
|
|
8892
|
+
return;
|
|
8893
|
+
}
|
|
8894
|
+
const languageExists = languages.some((lang) => lang.code === lang_code);
|
|
8895
|
+
if (languageExists) {
|
|
8896
|
+
try {
|
|
8897
|
+
changeLanguage(lang_code);
|
|
8898
|
+
} catch (error) {
|
|
8899
|
+
setLocalLanguageError(error instanceof Error ? error.message : "Failed to change language");
|
|
8900
|
+
}
|
|
8901
|
+
} else {
|
|
8902
|
+
const errorMsg = t("header.language_not_found", { language: lang_code }) || `Selected language "${lang_code}" is not available`;
|
|
8903
|
+
setLocalLanguageError(errorMsg);
|
|
8904
|
+
}
|
|
8905
|
+
};
|
|
8906
|
+
const handleRetryLanguages = async () => {
|
|
8907
|
+
setLocalLanguageError(null);
|
|
8908
|
+
try {
|
|
8909
|
+
await fetchLanguages();
|
|
8910
|
+
} catch (error) {
|
|
8911
|
+
setLocalLanguageError("Failed to reload languages");
|
|
8912
|
+
}
|
|
8913
|
+
};
|
|
8914
|
+
const availableLanguages = getLanguagesForDropdown();
|
|
8915
|
+
if (isLoading) {
|
|
8916
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: "language-chip language-chip-loading", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("header.language_loading") || "Loading..." }) });
|
|
8917
|
+
}
|
|
8918
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: "language-selector-wrapper", children: [
|
|
8919
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8920
|
+
"button",
|
|
8921
|
+
{
|
|
8922
|
+
className: `hdr-lang-btn ${isFallbackActive || languageContextError ? "language-fallback-active" : ""}`,
|
|
8923
|
+
type: "button",
|
|
8924
|
+
onClick: handleMenuOpen,
|
|
8925
|
+
children: [
|
|
8926
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "lang-text", children: getCurrentLanguageDisplay() }),
|
|
8927
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ArrowDown, { width: 14, height: 14 })
|
|
8928
|
+
]
|
|
8929
|
+
}
|
|
8930
|
+
),
|
|
8931
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
8932
|
+
Menu,
|
|
8933
|
+
{
|
|
8934
|
+
className: "main-profile-menu",
|
|
8935
|
+
anchorEl,
|
|
8936
|
+
open: isMenuOpen,
|
|
8937
|
+
onClose: handleMenuClose,
|
|
8938
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
8939
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
8940
|
+
children: [
|
|
8941
|
+
availableLanguages.map(({ code, label }) => /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { onClick: () => onChangeLang(code), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography$1, { type: "s4", weight: "medium", color: (currentLanguage == null ? void 0 : currentLanguage.code) === code ? "theme.primary.1000" : "theme.secondary.1000", children: label }) }, code)),
|
|
8942
|
+
languageContextError && /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { onClick: handleRetryLanguages, style: { fontStyle: "italic" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography$1, { type: "s4", weight: "medium", color: "theme.secondary.500", children: t("header.retry_languages") || "Retry loading languages" }) })
|
|
8943
|
+
]
|
|
8944
|
+
}
|
|
8945
|
+
),
|
|
8946
|
+
localLanguageError && /* @__PURE__ */ jsxRuntimeExports.jsx(Typography$1, { type: "s5", color: "theme.error.600", style: { position: "absolute", bottom: "-15px", whiteSpace: "nowrap" }, children: localLanguageError })
|
|
8947
|
+
] });
|
|
8948
|
+
}
|
|
8851
8949
|
const getNotificationUrl = (data) => {
|
|
8852
8950
|
var _a;
|
|
8853
8951
|
const { moduleName = "", moduleId = "", notificationData = {} } = data;
|
|
@@ -9709,6 +9807,7 @@ function Header(props) {
|
|
|
9709
9807
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1 } }),
|
|
9710
9808
|
/* @__PURE__ */ jsxRuntimeExports.jsx(GlobalSearch, {}),
|
|
9711
9809
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "notif-wrap", children: /* @__PURE__ */ jsxRuntimeExports.jsx(NotificationMenu, {}) }),
|
|
9810
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LanguageSwitch, {}),
|
|
9712
9811
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "v-divider" }),
|
|
9713
9812
|
/* @__PURE__ */ jsxRuntimeExports.jsx(UserMenu, {})
|
|
9714
9813
|
] });
|
|
@@ -9824,4 +9923,4 @@ export {
|
|
|
9824
9923
|
List as y,
|
|
9825
9924
|
Typography as z
|
|
9826
9925
|
};
|
|
9827
|
-
//# sourceMappingURL=appbar-
|
|
9926
|
+
//# sourceMappingURL=appbar-7puZelDZ.esm.js.map
|