@mailstep/design-system 0.13.0-beta.1 → 0.13.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ui/Blocks/Header/components/UserMenu/index.js +1 -1
- package/ui/Blocks/HidePrint/HidePrint.js +1 -1
- package/ui/Blocks/ImageList/ImageList.js +1 -1
- package/ui/Blocks/LoginPage/LoginPage.js +1 -1
- package/ui/Blocks/LoginPage/components/LoginForm.js +1 -1
- package/ui/Blocks/LoginPage/components/SocialLinks.js +1 -1
- package/ui/Blocks/Modal/Modal.js +1 -1
- package/ui/Blocks/Popover/index.js +1 -1
- package/ui/Blocks/Scheduler/components/BookedTimeSlots/index.js +1 -1
- package/ui/Blocks/Scheduler/components/DateChanger/index.js +1 -1
- package/ui/Blocks/SideMenu/components/Footer.js +1 -1
- package/ui/Blocks/SideMenu/components/HamburgerMenu.js +4 -4
- package/ui/Blocks/SideMenu/components/SubitemTooltip.js +1 -1
- package/ui/Blocks/Stepper/components/StepItem/index.js +1 -1
- package/ui/Elements/Alert/Alert.js +1 -1
- package/ui/Elements/Alert/styles.js +10 -10
- package/ui/Elements/Badge/Badge.js +1 -1
- package/ui/Elements/BarChartSymbol/BarChartSymbol.js +1 -1
- package/ui/Elements/BorderedBox/BorderedBox.js +1 -1
- package/ui/Elements/DatePicker/DatePicker.js +6 -2
- package/ui/Elements/DatePicker/Datetime/components/DateRepeater.js +1 -1
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/Timepicker.js +17 -7
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/constants.d.ts +1 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/constants.js +2 -1
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/utils/index.d.ts +1 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/utils/index.js +2 -1
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/utils/isTimeFieldComplete.d.ts +3 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/utils/isTimeFieldComplete.js +5 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker/utils/sanitizeTimeField.js +1 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/DatePickerInput.d.ts +6 -2
- package/ui/Elements/DatePicker/components/DatePickerInput/DatePickerInput.js +35 -6
- package/ui/Elements/DatePicker/components/DatePickerInput/constants.d.ts +5 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/constants.js +16 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/applyDateMask.d.ts +3 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/applyDateMask.js +19 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/countDigits.d.ts +3 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/countDigits.js +5 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/getMaskedCaretPosition.d.ts +3 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/getMaskedCaretPosition.js +14 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/index.d.ts +4 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/index.js +5 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/isMaskableFormat.d.ts +3 -0
- package/ui/Elements/DatePicker/components/DatePickerInput/utils/isMaskableFormat.js +9 -0
- package/ui/Elements/DatePicker/utils/getInputFormat.d.ts +3 -0
- package/ui/Elements/DatePicker/utils/getInputFormat.js +10 -0
- package/ui/Elements/Dropdown/Dropdown.js +1 -1
- package/ui/Elements/DropdownMenu/DropdownMenu.js +1 -1
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +1 -1
- package/ui/Elements/DropdownMenu/components/MenuItem.js +1 -1
- package/ui/Elements/DropdownSelect/DropdownSelect.js +1 -1
- package/ui/Elements/ErrorMessage/ErrorMessage.js +1 -1
- package/ui/Elements/HighlightBox/HighlightBox.js +1 -1
- package/ui/Elements/Icon/BadgeIcon.js +1 -1
- package/ui/Elements/Icon/Icon.js +1 -1
- package/ui/Elements/Line/Line.js +1 -1
- package/ui/Elements/Link/Link.js +1 -1
- package/ui/Elements/Logo/Logo.js +1 -1
- package/ui/Elements/Select/Select.js +1 -1
- package/ui/Elements/Select/components/CountMultiValue.js +1 -1
- package/ui/Elements/Select/components/DropdownIndicator.js +1 -1
- package/ui/Elements/Select/components/IconValueContainer.js +1 -1
- package/ui/Elements/Select/components/SelectAll.js +1 -1
- package/ui/Elements/SpaceAround/SpaceAround.js +1 -1
- package/ui/Elements/Tag/stories/components/predefinedTags.js +1 -1
- package/ui/Elements/Text/Text.js +1 -1
- package/ui/Elements/Toast/Toast.js +1 -1
- package/ui/Elements/Toggle/Toggle.js +1 -1
- package/ui/Elements/Tooltip/Tooltip.js +1 -1
- package/ui/Modules/CommonGrid/CommonGrid.d.ts +1 -1
- package/ui/Modules/CommonGrid/CommonGrid.js +7 -5
- package/ui/Modules/CommonGrid/CommonGridContainer.js +4 -4
- package/ui/Modules/CommonGrid/components/ActionHead/ActionHead.js +1 -1
- package/ui/Modules/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +1 -1
- package/ui/Modules/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +1 -1
- package/ui/Modules/CommonGrid/components/ButtonMore/ButtonMore.js +1 -1
- package/ui/Modules/CommonGrid/components/ColumnFilterCell.js +3 -2
- package/ui/Modules/CommonGrid/components/ColumnTitle/ColumnTitle.js +1 -1
- package/ui/Modules/CommonGrid/components/ColumnTitle.js +1 -1
- package/ui/Modules/CommonGrid/components/ControlButtons/ControlButtons.js +1 -1
- package/ui/Modules/CommonGrid/components/DropdownButton/DropdownButton.js +1 -1
- package/ui/Modules/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +1 -1
- package/ui/Modules/CommonGrid/components/FilterDropdown.js +1 -1
- package/ui/Modules/CommonGrid/components/FilterRow.d.ts +1 -0
- package/ui/Modules/CommonGrid/components/FilterRow.js +6 -1
- package/ui/Modules/CommonGrid/components/Filters/ActionsFilter/ActionsFilter.js +1 -1
- package/ui/Modules/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +1 -1
- package/ui/Modules/CommonGrid/components/FloatingButton/FloatingButton.js +1 -1
- package/ui/Modules/CommonGrid/components/GridInfo/index.js +1 -1
- package/ui/Modules/CommonGrid/components/HeadCell.js +1 -0
- package/ui/Modules/CommonGrid/components/HeadRow.d.ts +1 -0
- package/ui/Modules/CommonGrid/components/HeadRow.js +11 -6
- package/ui/Modules/CommonGrid/components/IconList/IconList.js +1 -1
- package/ui/Modules/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +1 -1
- package/ui/Modules/CommonGrid/components/ManageColumnForm/components/ManageColumnRow.js +1 -1
- package/ui/Modules/CommonGrid/components/MobileFilterModal.js +1 -1
- package/ui/Modules/CommonGrid/components/MobileSortModal.js +1 -1
- package/ui/Modules/CommonGrid/components/OversizedScroll.js +1 -1
- package/ui/Modules/CommonGrid/components/PresetsModalBody/index.js +1 -1
- package/ui/Modules/CommonGrid/components/QuickFilter/QuickFilter.js +1 -1
- package/ui/Modules/CommonGrid/components/Resize.js +1 -1
- package/ui/Modules/CommonGrid/components/TablePagination/TablePagination.js +1 -1
- package/ui/Modules/CommonGrid/components/gridCells/BoolIcon.js +1 -1
- package/ui/Modules/CommonGrid/components/gridCells/EnumInCell.js +1 -1
- package/ui/Modules/CommonGrid/components/gridCells/HoverBubble.js +1 -1
- package/ui/Modules/CommonGrid/components/gridCells/IconButtonInCell.js +1 -1
- package/ui/Modules/CommonGrid/components/gridCells/ImageCell.js +1 -1
- package/ui/Modules/CommonGrid/components/gridCells/RemoveItem.js +1 -1
- package/ui/Modules/CommonGrid/components/gridCells/RowActionsCell.js +1 -1
- package/ui/Modules/CommonGrid/styles.d.ts +1 -1
- package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.js +1 -1
- package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.js +1 -1
- package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.js +1 -1
- package/ui/Modules/Dashboard/errors/ErrorMessage.js +1 -1
- package/ui/ThemeProvider/ThemeProvider.js +1 -1
- package/ui/index.js +1 -1
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@ import { UserInfoBlock } from "./components/UserInfo/index.js";
|
|
|
6
6
|
import { useLogout } from "./hooks/useLogout.js";
|
|
7
7
|
import { DropdownContentWrap, Line } from "./styles.js";
|
|
8
8
|
import { useRef } from "react";
|
|
9
|
-
import { th, useTheme } from "@xstyled/styled-components";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { th, useTheme } from "@xstyled/styled-components";
|
|
11
11
|
import { Trans } from "@lingui/react";
|
|
12
12
|
//#region packages/ui/Blocks/Header/components/UserMenu/index.tsx
|
|
13
13
|
const UserMenu = ({ user, onLogout, hasUserMenu, userMenuOverride, withInitials, withChevron, withName, ignoreClickOutsideClosest }) => {
|
|
@@ -7,8 +7,8 @@ import { useControls } from "./hooks/useControls.js";
|
|
|
7
7
|
import { useOnElementClick } from "./hooks/useOnElementClick.js";
|
|
8
8
|
import { Control, ImageListContainer } from "./styles.js";
|
|
9
9
|
import { useRef } from "react";
|
|
10
|
-
import { x } from "@xstyled/styled-components";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { x } from "@xstyled/styled-components";
|
|
12
12
|
import { useDraggable } from "react-use-draggable-scroll";
|
|
13
13
|
//#region packages/ui/Blocks/ImageList/ImageList.tsx
|
|
14
14
|
const ImageList = ({ onImageUpload, onImageRemove, onImageClick, lightBoxAction, lightBoxActionTitle, images, isDisabled, selectable, max }) => {
|
|
@@ -5,8 +5,8 @@ import { LoginForm } from "./components/LoginForm.js";
|
|
|
5
5
|
import "./utils/links.js";
|
|
6
6
|
import { SocialLinks } from "./components/SocialLinks.js";
|
|
7
7
|
import { CardBodyWithLanguage, LanguageBox, LogoWrapper, MailTo, MainLogo, Version, Wrapper } from "./styles.js";
|
|
8
|
-
import { x } from "@xstyled/styled-components";
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { x } from "@xstyled/styled-components";
|
|
10
10
|
import { Trans } from "@lingui/react";
|
|
11
11
|
//#region packages/ui/Blocks/LoginPage/LoginPage.tsx
|
|
12
12
|
const Login = ({ onSubmit, activeLanguage, onLanguageChange, children, brand, brandVariant, isSubmitting, isSubmitDisabled, withDistributionCenterSelect, distributionCenterOptions, selectedDistributionCenter, onChangeDistributionCenter, languageItems, version, backgroundImage, admin, hasSupport = true, hasSocialLinks = true, withPassword = true, withLogin = true, loginLabel, passwordLabel, formHeader }) => {
|
|
@@ -2,8 +2,8 @@ import Button from "../../../Elements/Button/Button.js";
|
|
|
2
2
|
import SingleSelect from "../../../Elements/SingleSelect/SingleSelect.js";
|
|
3
3
|
import { Input } from "../../../Forms/Input/Input.js";
|
|
4
4
|
import { useCallback, useState } from "react";
|
|
5
|
-
import styled$1, { x } from "@xstyled/styled-components";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import styled$1, { x } from "@xstyled/styled-components";
|
|
7
7
|
import { i18n } from "@lingui/core";
|
|
8
8
|
import { Trans } from "@lingui/react";
|
|
9
9
|
//#region packages/ui/Blocks/LoginPage/components/LoginForm.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Icon from "../../../Elements/Icon/Icon.js";
|
|
2
2
|
import { FACEBOOK_LINK, INSTAGRAM_LINK, LINKEDIN_LINK, TWITTER_LINK } from "../utils/links.js";
|
|
3
|
-
import styled$1, { th } from "@xstyled/styled-components";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import styled$1, { th } from "@xstyled/styled-components";
|
|
5
5
|
import { Trans } from "@lingui/react";
|
|
6
6
|
//#region packages/ui/Blocks/LoginPage/components/SocialLinks.tsx
|
|
7
7
|
const SocialLinksWrapper = styled$1.div`
|
package/ui/Blocks/Modal/Modal.js
CHANGED
|
@@ -9,8 +9,8 @@ import { Portal } from "../../Elements/Portal/index.js";
|
|
|
9
9
|
import { ButtonsContainer, ButtonsWrapper, CloseButton, ContentContainer, DialogOverlay, DialogWindow, HeaderContainer, TitleContainer } from "./styles.js";
|
|
10
10
|
import { widthMap } from "./utils.js";
|
|
11
11
|
import { memo, useCallback, useEffect, useMemo } from "react";
|
|
12
|
-
import { x } from "@xstyled/styled-components";
|
|
13
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { x } from "@xstyled/styled-components";
|
|
14
14
|
//#region packages/ui/Blocks/Modal/Modal.tsx
|
|
15
15
|
const Modal = memo(({ children, isShown = true, onExtraAction, onCancel, title, titleIcon, onConfirm, confirmLabel, cancelLabel, extraActionLabel, isLoading, isConfirmDisabled, width = "narrow", onClose, hasFooter = true, hasHeader = true, background, ignoreClickOutside = false, closeEverywhere = false, withCloseIcon = true, overlayColor, minWidth, minHeight, maxWidth, maxHeight, variant = "compact", top, name }) => {
|
|
16
16
|
const closeDialog = useCallback(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useClickOutside } from "../Modal/hooks/useClickOutside.js";
|
|
2
2
|
import { Portal } from "../../Elements/Portal/index.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import styled$1 from "@xstyled/styled-components";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import styled$1 from "@xstyled/styled-components";
|
|
6
6
|
import { Popper } from "react-popper";
|
|
7
7
|
//#region packages/ui/Blocks/Popover/index.tsx
|
|
8
8
|
const PopoverWrapper = styled$1.div`
|
|
@@ -2,8 +2,8 @@ import { getMinutesFromTime } from "../../utils/getMinutesFromTime.js";
|
|
|
2
2
|
import { convertDateToTime } from "../../utils/convertDateToTime.js";
|
|
3
3
|
import { convertMinutesToDuration } from "../../utils/convertMinutesToDuration.js";
|
|
4
4
|
import { Body, BookedTimeSlot, Header } from "./styles.js";
|
|
5
|
-
import { x } from "@xstyled/styled-components";
|
|
6
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { x } from "@xstyled/styled-components";
|
|
7
7
|
import get from "lodash/get";
|
|
8
8
|
//#region packages/ui/Blocks/Scheduler/components/BookedTimeSlots/index.tsx
|
|
9
9
|
const BookedTimeSlots = ({ bookedTimeSlots, timeSlotDefinitions, handleTimeSlotClick, time }) => {
|
|
@@ -7,8 +7,8 @@ import Popover from "../../../Popover/index.js";
|
|
|
7
7
|
import { formatDate } from "../../utils/formatDate.js";
|
|
8
8
|
import { ArrowContainer, DateChangerContainer } from "./styles.js";
|
|
9
9
|
import { useContext, useRef } from "react";
|
|
10
|
-
import { x } from "@xstyled/styled-components";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { x } from "@xstyled/styled-components";
|
|
12
12
|
//#region packages/ui/Blocks/Scheduler/components/DateChanger/index.tsx
|
|
13
13
|
const DateChanger = ({ isLoading, date, handleChangeDate, closeDatePicker, handleNextDay, handlePrevDay, toggleDatepicker, isDatepickerOpen }) => {
|
|
14
14
|
const ref = useRef(null);
|
|
@@ -2,8 +2,8 @@ import { MenuItems } from "../../../Elements/Icon/icons/MenuItems.js";
|
|
|
2
2
|
import { Paragraph4 } from "../../../Elements/Typography/Typography.js";
|
|
3
3
|
import "../../../Elements/Typography/index.js";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
|
-
import styled$1, { css } from "@xstyled/styled-components";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import styled$1, { css } from "@xstyled/styled-components";
|
|
7
7
|
import { th as th$1 } from "@xstyled/system";
|
|
8
8
|
import { Trans } from "@lingui/react";
|
|
9
9
|
//#region packages/ui/Blocks/SideMenu/components/Footer.tsx
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HamburgerMenu } from "../../../Elements/Icon/icons/HamburgerMenu.js";
|
|
2
2
|
import { MobileCancel } from "../../../Elements/Icon/icons/MobileCancel.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import
|
|
4
|
+
import styled from "styled-components";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { css, useTheme as useTheme$1, x } from "@xstyled/styled-components";
|
|
6
7
|
import { th as th$1 } from "@xstyled/system";
|
|
7
|
-
import styled$2 from "styled-components";
|
|
8
8
|
//#region packages/ui/Blocks/SideMenu/components/HamburgerMenu.tsx
|
|
9
|
-
const HamburgerMenuWrapper = styled
|
|
9
|
+
const HamburgerMenuWrapper = styled(x.div)`
|
|
10
10
|
width: 36px;
|
|
11
11
|
height: 36px;
|
|
12
12
|
border-radius: 70px;
|
|
@@ -36,7 +36,7 @@ const HamburgerMenuWrapper = styled$2(x.div)`
|
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
38
|
const HamburgerMenuButton = ({ isLeftMenuOpen, onClick }) => {
|
|
39
|
-
const theme = useTheme();
|
|
39
|
+
const theme = useTheme$1();
|
|
40
40
|
const neutralColor = th$1.color("neutral20")({ theme });
|
|
41
41
|
return /* @__PURE__ */ jsx(HamburgerMenuWrapper, {
|
|
42
42
|
mr: "8px",
|
|
@@ -2,8 +2,8 @@ import { H6 } from "../../../Elements/Typography/Typography.js";
|
|
|
2
2
|
import { Portal } from "../../../Elements/Portal/index.js";
|
|
3
3
|
import { ItemLinkWrap, TooltipItemLabel, TooltipWrap } from "../styles.js";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
5
|
import styled from "styled-components";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { Popper } from "react-popper";
|
|
8
8
|
//#region packages/ui/Blocks/SideMenu/components/SubitemTooltip.tsx
|
|
9
9
|
const TooltipItem = ({ title, link = "", lightMode }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { H7, Paragraph2 } from "../../../../Elements/Typography/Typography.js";
|
|
2
2
|
import { StepCircle } from "../StepCircle/index.js";
|
|
3
3
|
import { ContentWrapper, Line, StepItemContainer } from "./styles.js";
|
|
4
|
-
import { x } from "@xstyled/styled-components";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { x } from "@xstyled/styled-components";
|
|
6
6
|
import { Trans } from "@lingui/react";
|
|
7
7
|
import isBoolean from "lodash/isBoolean";
|
|
8
8
|
//#region packages/ui/Blocks/Stepper/components/StepItem/index.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Icon from "../Icon/Icon.js";
|
|
2
2
|
import "../Icon/index.js";
|
|
3
3
|
import { ActionButton, CloseBtn, Description, IconWrap, LinkWrapper, StyledAlert, Text, Title, VerticalSeparator } from "./styles.js";
|
|
4
|
-
import { th, useTheme, x } from "@xstyled/styled-components";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { th, useTheme, x } from "@xstyled/styled-components";
|
|
6
6
|
//#region packages/ui/Elements/Alert/Alert.tsx
|
|
7
7
|
const alertBackgroundColor = {
|
|
8
8
|
success: "green10",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Link from "../Link/Link.js";
|
|
2
2
|
import "../Link/index.js";
|
|
3
|
+
import styled from "styled-components";
|
|
3
4
|
import { th, x } from "@xstyled/styled-components";
|
|
4
|
-
import styled$2 from "styled-components";
|
|
5
5
|
//#region packages/ui/Elements/Alert/styles.ts
|
|
6
|
-
const StyledAlert = styled
|
|
6
|
+
const StyledAlert = styled(x.div)`
|
|
7
7
|
width: calc(100vw - 20px);
|
|
8
8
|
display: flex;
|
|
9
9
|
min-height: 48px;
|
|
@@ -24,32 +24,32 @@ const StyledAlert = styled$2(x.div)`
|
|
|
24
24
|
width: 100%;
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
|
-
const VerticalSeparator = styled
|
|
27
|
+
const VerticalSeparator = styled(x.div)`
|
|
28
28
|
width: 4px;
|
|
29
29
|
height: 36px;
|
|
30
30
|
border-radius: 94px;
|
|
31
31
|
background-color: ${({ $colorFill }) => $colorFill};
|
|
32
32
|
`;
|
|
33
|
-
const IconWrap = styled
|
|
33
|
+
const IconWrap = styled(x.div)`
|
|
34
34
|
margin: 0 13px 0 9px;
|
|
35
35
|
`;
|
|
36
|
-
const Title = styled
|
|
36
|
+
const Title = styled.span`
|
|
37
37
|
font-size: 14px;
|
|
38
38
|
line-height: 18px;
|
|
39
39
|
font-weight: 600;
|
|
40
40
|
`;
|
|
41
|
-
const Text = styled
|
|
41
|
+
const Text = styled.span`
|
|
42
42
|
font-size: 14px;
|
|
43
43
|
line-height: 20px;
|
|
44
44
|
font-weight: 400;
|
|
45
45
|
`;
|
|
46
|
-
const LinkWrapper = styled
|
|
46
|
+
const LinkWrapper = styled(Link)`
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
font-weight: 600;
|
|
49
49
|
color: ${({ $colorFill }) => $colorFill};
|
|
50
50
|
margin-right: 10px;
|
|
51
51
|
`;
|
|
52
|
-
const ActionButton = styled
|
|
52
|
+
const ActionButton = styled.button`
|
|
53
53
|
margin-right: 10px;
|
|
54
54
|
font-size: 14px;
|
|
55
55
|
font-weight: 600;
|
|
@@ -58,7 +58,7 @@ const ActionButton = styled$2.button`
|
|
|
58
58
|
background-color: transparent;
|
|
59
59
|
cursor: pointer;
|
|
60
60
|
`;
|
|
61
|
-
const CloseBtn = styled
|
|
61
|
+
const CloseBtn = styled.button`
|
|
62
62
|
height: 30px;
|
|
63
63
|
width: 30px;
|
|
64
64
|
display: flex;
|
|
@@ -71,7 +71,7 @@ const CloseBtn = styled$2.button`
|
|
|
71
71
|
cursor: pointer;
|
|
72
72
|
}
|
|
73
73
|
`;
|
|
74
|
-
const Description = styled
|
|
74
|
+
const Description = styled.div`
|
|
75
75
|
position: absolute;
|
|
76
76
|
top: 3px;
|
|
77
77
|
right: 8px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import styled$1, { css, th, useTheme } from "@xstyled/styled-components";
|
|
3
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import styled$1, { css, th, useTheme } from "@xstyled/styled-components";
|
|
4
4
|
//#region packages/ui/Elements/Badge/Badge.tsx
|
|
5
5
|
const Circle = styled$1.div`
|
|
6
6
|
min-width: 12px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Bar } from "./styles.js";
|
|
2
|
-
import { x } from "@xstyled/styled-components";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { x } from "@xstyled/styled-components";
|
|
4
4
|
//#region packages/ui/Elements/BarChartSymbol/BarChartSymbol.tsx
|
|
5
5
|
const BarChartSymbol = ({ total = 3, height = 14, minHeight = 7, selected = 3, gap = 2, width = 3, color }) => {
|
|
6
6
|
return /* @__PURE__ */ jsx(x.div, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import styled$1, { x } from "@xstyled/styled-components";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import styled$1, { x } from "@xstyled/styled-components";
|
|
4
4
|
//#region packages/ui/Elements/BorderedBox/BorderedBox.tsx
|
|
5
5
|
const StyledBox = styled$1(x.div)`
|
|
6
6
|
display: flex;
|
|
@@ -3,10 +3,11 @@ import SpaceAround_default from "../SpaceAround/index.js";
|
|
|
3
3
|
import Datetime from "./Datetime/DateTime.js";
|
|
4
4
|
import { DatePickerInput } from "./components/DatePickerInput/DatePickerInput.js";
|
|
5
5
|
import "./components/DatePickerInput/index.js";
|
|
6
|
+
import { getInputFormat } from "./utils/getInputFormat.js";
|
|
6
7
|
import { DatePickerBase } from "./styles.js";
|
|
7
8
|
import React, { useCallback, useContext } from "react";
|
|
8
|
-
import { x } from "@xstyled/styled-components";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
import { x } from "@xstyled/styled-components";
|
|
10
11
|
import "moment/dist/locale/cs";
|
|
11
12
|
import "moment/dist/locale/el";
|
|
12
13
|
import "moment/dist/locale/it";
|
|
@@ -16,9 +17,11 @@ import "moment/dist/locale/sk";
|
|
|
16
17
|
const defaultDateFormat = "DD.MM.YYYY";
|
|
17
18
|
const DatePicker = ({ name, value, initialViewDate, error, label, disabled, isValidDate, onChange, dateFormat = defaultDateFormat, timeFormat = false, open, secondValue = null, input, icon = true, showInputLabel = false, showCalendarLabel = true, spaceAround = false, className, onClear, onInputChange, ...passProps }) => {
|
|
18
19
|
const locale = useContext(LanguageContext);
|
|
20
|
+
const inputFormat = getInputFormat(dateFormat, timeFormat);
|
|
19
21
|
const handleRenderInput = useCallback((inputProps, openCalendar) => /* @__PURE__ */ jsx(DatePickerInput, {
|
|
20
22
|
inputProps,
|
|
21
23
|
openCalendar,
|
|
24
|
+
format: inputFormat,
|
|
22
25
|
name,
|
|
23
26
|
label,
|
|
24
27
|
error,
|
|
@@ -35,7 +38,8 @@ const DatePicker = ({ name, value, initialViewDate, error, label, disabled, isVa
|
|
|
35
38
|
icon,
|
|
36
39
|
showInputLabel,
|
|
37
40
|
onClear,
|
|
38
|
-
onInputChange
|
|
41
|
+
onInputChange,
|
|
42
|
+
inputFormat
|
|
39
43
|
]);
|
|
40
44
|
const handleRenderView = useCallback((_, renderCalendar) => {
|
|
41
45
|
if (label && !showInputLabel) return /* @__PURE__ */ jsx(x.div, {
|
|
@@ -4,8 +4,8 @@ import { DatePickerRepeatTrans } from "../../utils/constants.js";
|
|
|
4
4
|
import { FooterRow } from "./FooterRow.js";
|
|
5
5
|
import { FooterRowLabel } from "./FooterRowLabel.js";
|
|
6
6
|
import { useCallback } from "react";
|
|
7
|
-
import { x } from "@xstyled/styled-components";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { x } from "@xstyled/styled-components";
|
|
9
9
|
import { i18n } from "@lingui/core";
|
|
10
10
|
//#region packages/ui/Elements/DatePicker/Datetime/components/DateRepeater.tsx
|
|
11
11
|
const DateRepeater = ({ onChangeOthers, others, reset }) => {
|
|
@@ -4,11 +4,13 @@ import { FooterRowLabel } from "../FooterRowLabel.js";
|
|
|
4
4
|
import "./constants.js";
|
|
5
5
|
import { TimeButton, TimeField, TimeWrapper } from "./styles.js";
|
|
6
6
|
import { padTime } from "./utils/padTime.js";
|
|
7
|
+
import { isTimeFieldComplete } from "./utils/isTimeFieldComplete.js";
|
|
7
8
|
import { parseTimeField } from "./utils/parseTimeField.js";
|
|
8
9
|
import { sanitizeTimeField } from "./utils/sanitizeTimeField.js";
|
|
10
|
+
import "./utils/index.js";
|
|
9
11
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
10
|
-
import { x } from "@xstyled/styled-components";
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { x } from "@xstyled/styled-components";
|
|
12
14
|
import { i18n } from "@lingui/core";
|
|
13
15
|
//#region packages/ui/Elements/DatePicker/Datetime/components/Timepicker/Timepicker.tsx
|
|
14
16
|
const Timepicker = ({ setTime, value, disabled }) => {
|
|
@@ -18,6 +20,7 @@ const Timepicker = ({ setTime, value, disabled }) => {
|
|
|
18
20
|
const [minutesValue, setMinutesValue] = useState(padTime(minutes));
|
|
19
21
|
const isHoursEdited = useRef(false);
|
|
20
22
|
const isMinutesEdited = useRef(false);
|
|
23
|
+
const minutesRef = useRef(null);
|
|
21
24
|
useEffect(() => {
|
|
22
25
|
if (isHoursEdited.current) return;
|
|
23
26
|
setHoursValue(padTime(hours));
|
|
@@ -72,6 +75,8 @@ const Timepicker = ({ setTime, value, disabled }) => {
|
|
|
72
75
|
const parsed = parseTimeField(nextValue, NaN);
|
|
73
76
|
if (Number.isNaN(parsed) || parsed > 23) return;
|
|
74
77
|
commitTime("hours", parsed);
|
|
78
|
+
if (!isTimeFieldComplete(nextValue, parsed, 23)) return;
|
|
79
|
+
minutesRef.current?.focus();
|
|
75
80
|
}, [commitTime]);
|
|
76
81
|
const onMinutesChange = useCallback((e) => {
|
|
77
82
|
const nextValue = sanitizeTimeField(e.target.value);
|
|
@@ -93,14 +98,18 @@ const Timepicker = ({ setTime, value, disabled }) => {
|
|
|
93
98
|
}, []);
|
|
94
99
|
const onHoursBlur = useCallback(() => {
|
|
95
100
|
isHoursEdited.current = false;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
setHoursValue((prev) => {
|
|
102
|
+
const parsed = parseTimeField(prev, NaN);
|
|
103
|
+
return padTime(!Number.isNaN(parsed) && parsed <= 23 ? parsed : hours);
|
|
104
|
+
});
|
|
105
|
+
}, [hours]);
|
|
99
106
|
const onMinutesBlur = useCallback(() => {
|
|
100
107
|
isMinutesEdited.current = false;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
setMinutesValue((prev) => {
|
|
109
|
+
const parsed = parseTimeField(prev, NaN);
|
|
110
|
+
return padTime(!Number.isNaN(parsed) && parsed <= 59 ? parsed : minutes);
|
|
111
|
+
});
|
|
112
|
+
}, [minutes]);
|
|
104
113
|
return /* @__PURE__ */ jsxs(FooterRow, {
|
|
105
114
|
disabled,
|
|
106
115
|
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Icon, { icon: "clock" }), /* @__PURE__ */ jsx(FooterRowLabel, { children: i18n._({
|
|
@@ -147,6 +156,7 @@ const Timepicker = ({ setTime, value, disabled }) => {
|
|
|
147
156
|
children: ":"
|
|
148
157
|
}),
|
|
149
158
|
/* @__PURE__ */ jsx(TimeField, {
|
|
159
|
+
ref: minutesRef,
|
|
150
160
|
value: minutesValue,
|
|
151
161
|
disabled,
|
|
152
162
|
inputMode: "numeric",
|
|
@@ -4,5 +4,6 @@ const MINUTES_COUNT = 60;
|
|
|
4
4
|
const MINUTES_STEP = 5;
|
|
5
5
|
const MAX_HOURS = 23;
|
|
6
6
|
const MAX_MINUTES = 59;
|
|
7
|
+
const TIME_FIELD_LENGTH = 2;
|
|
7
8
|
//#endregion
|
|
8
|
-
export { HOURS_COUNT, MAX_HOURS, MAX_MINUTES, MINUTES_COUNT, MINUTES_STEP };
|
|
9
|
+
export { HOURS_COUNT, MAX_HOURS, MAX_MINUTES, MINUTES_COUNT, MINUTES_STEP, TIME_FIELD_LENGTH };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { padTime } from "./padTime.js";
|
|
2
|
+
import { isTimeFieldComplete } from "./isTimeFieldComplete.js";
|
|
2
3
|
import { parseTimeField } from "./parseTimeField.js";
|
|
3
4
|
import { sanitizeTimeField } from "./sanitizeTimeField.js";
|
|
4
|
-
export { padTime, parseTimeField, sanitizeTimeField };
|
|
5
|
+
export { isTimeFieldComplete, padTime, parseTimeField, sanitizeTimeField };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { type FC, type InputHTMLAttributes } from 'react';
|
|
1
|
+
import { type ChangeEvent, type FC, type InputHTMLAttributes } from 'react';
|
|
2
|
+
type DatetimeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
|
|
3
|
+
onChange?: (event: ChangeEvent<HTMLInputElement> | string) => void;
|
|
4
|
+
};
|
|
2
5
|
type DatePickerInputProps = {
|
|
3
|
-
inputProps:
|
|
6
|
+
inputProps: DatetimeInputProps;
|
|
4
7
|
openCalendar: () => void;
|
|
8
|
+
format: string;
|
|
5
9
|
name?: string;
|
|
6
10
|
label?: string;
|
|
7
11
|
error?: string;
|
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
import Input_default from "../../../../Forms/Input/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { applyDateMask } from "./utils/applyDateMask.js";
|
|
3
|
+
import { countDigits } from "./utils/countDigits.js";
|
|
4
|
+
import { getMaskedCaretPosition } from "./utils/getMaskedCaretPosition.js";
|
|
5
|
+
import { isMaskableFormat } from "./utils/isMaskableFormat.js";
|
|
6
|
+
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
3
7
|
import { jsx } from "react/jsx-runtime";
|
|
4
8
|
//#region packages/ui/Elements/DatePicker/components/DatePickerInput/DatePickerInput.tsx
|
|
5
|
-
const DatePickerInput = ({ inputProps, openCalendar, name, label, error, disabled, icon, showInputLabel, onClear, onInputChange }) => {
|
|
9
|
+
const DatePickerInput = ({ inputProps, openCalendar, format, name, label, error, disabled, icon, showInputLabel, onClear, onInputChange }) => {
|
|
6
10
|
const [typedValue, setTypedValue] = useState(null);
|
|
11
|
+
const inputRef = useRef(null);
|
|
12
|
+
const caretPosition = useRef(null);
|
|
13
|
+
const isMasked = isMaskableFormat(format);
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
if (caretPosition.current === null) return;
|
|
16
|
+
const caret = caretPosition.current;
|
|
17
|
+
caretPosition.current = null;
|
|
18
|
+
inputRef.current?.setSelectionRange(caret, caret);
|
|
19
|
+
});
|
|
7
20
|
const handleChange = useCallback((e) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
if (!isMasked) {
|
|
22
|
+
setTypedValue(e.target.value);
|
|
23
|
+
inputProps.onChange?.(e);
|
|
24
|
+
onInputChange?.(e.target.value);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const { value, selectionStart } = e.target;
|
|
28
|
+
const digitsBeforeCaret = countDigits(value.slice(0, selectionStart ?? value.length));
|
|
29
|
+
const maskedValue = applyDateMask(value, format);
|
|
30
|
+
caretPosition.current = getMaskedCaretPosition(maskedValue, digitsBeforeCaret);
|
|
31
|
+
setTypedValue(maskedValue);
|
|
32
|
+
inputProps.onChange?.(maskedValue);
|
|
33
|
+
onInputChange?.(maskedValue);
|
|
34
|
+
}, [
|
|
35
|
+
inputProps,
|
|
36
|
+
onInputChange,
|
|
37
|
+
isMasked,
|
|
38
|
+
format
|
|
39
|
+
]);
|
|
12
40
|
const handleBlur = useCallback(() => {
|
|
13
41
|
setTypedValue(null);
|
|
14
42
|
}, []);
|
|
@@ -19,6 +47,7 @@ const DatePickerInput = ({ inputProps, openCalendar, name, label, error, disable
|
|
|
19
47
|
error,
|
|
20
48
|
disabled,
|
|
21
49
|
isInvalid: !!error,
|
|
50
|
+
inputRef,
|
|
22
51
|
onChange: handleChange,
|
|
23
52
|
onBlur: handleBlur,
|
|
24
53
|
label: showInputLabel ? label : void 0,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region packages/ui/Elements/DatePicker/components/DatePickerInput/constants.ts
|
|
2
|
+
const MASKABLE_TOKENS = [
|
|
3
|
+
"DD",
|
|
4
|
+
"MM",
|
|
5
|
+
"YY",
|
|
6
|
+
"YYYY",
|
|
7
|
+
"HH",
|
|
8
|
+
"mm",
|
|
9
|
+
"ss"
|
|
10
|
+
];
|
|
11
|
+
const DIGIT_PATTERN = /\d/;
|
|
12
|
+
const FORMAT_SLOT_PATTERN = /[A-Za-z]/;
|
|
13
|
+
const NON_DIGIT_PATTERN = /\D/g;
|
|
14
|
+
const FORMAT_TOKEN_PATTERN = /[A-Za-z]+/g;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DIGIT_PATTERN, FORMAT_SLOT_PATTERN, FORMAT_TOKEN_PATTERN, MASKABLE_TOKENS, NON_DIGIT_PATTERN };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FORMAT_SLOT_PATTERN, NON_DIGIT_PATTERN } from "../constants.js";
|
|
2
|
+
//#region packages/ui/Elements/DatePicker/components/DatePickerInput/utils/applyDateMask.ts
|
|
3
|
+
const applyDateMask = (value, format) => {
|
|
4
|
+
const digits = value.replace(NON_DIGIT_PATTERN, "");
|
|
5
|
+
let masked = "";
|
|
6
|
+
let digitIndex = 0;
|
|
7
|
+
for (const char of format) {
|
|
8
|
+
if (digitIndex >= digits.length) break;
|
|
9
|
+
if (FORMAT_SLOT_PATTERN.test(char)) {
|
|
10
|
+
masked += digits[digitIndex];
|
|
11
|
+
digitIndex += 1;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
masked += char;
|
|
15
|
+
}
|
|
16
|
+
return masked;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { applyDateMask };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DIGIT_PATTERN } from "../constants.js";
|
|
2
|
+
//#region packages/ui/Elements/DatePicker/components/DatePickerInput/utils/getMaskedCaretPosition.ts
|
|
3
|
+
const getMaskedCaretPosition = (maskedValue, digitsBeforeCaret) => {
|
|
4
|
+
if (digitsBeforeCaret <= 0) return 0;
|
|
5
|
+
let digits = 0;
|
|
6
|
+
for (let index = 0; index < maskedValue.length; index += 1) {
|
|
7
|
+
if (!DIGIT_PATTERN.test(maskedValue[index])) continue;
|
|
8
|
+
digits += 1;
|
|
9
|
+
if (digits === digitsBeforeCaret) return index + 1;
|
|
10
|
+
}
|
|
11
|
+
return maskedValue.length;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getMaskedCaretPosition };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { applyDateMask } from "./applyDateMask.js";
|
|
2
|
+
import { countDigits } from "./countDigits.js";
|
|
3
|
+
import { getMaskedCaretPosition } from "./getMaskedCaretPosition.js";
|
|
4
|
+
import { isMaskableFormat } from "./isMaskableFormat.js";
|
|
5
|
+
export { applyDateMask, countDigits, getMaskedCaretPosition, isMaskableFormat };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FORMAT_TOKEN_PATTERN, MASKABLE_TOKENS } from "../constants.js";
|
|
2
|
+
//#region packages/ui/Elements/DatePicker/components/DatePickerInput/utils/isMaskableFormat.ts
|
|
3
|
+
const isMaskableFormat = (format) => {
|
|
4
|
+
const tokens = format.match(FORMAT_TOKEN_PATTERN);
|
|
5
|
+
if (!tokens?.length) return false;
|
|
6
|
+
return tokens.every((token) => MASKABLE_TOKENS.includes(token));
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { isMaskableFormat };
|