@alfalab/core-components-date-time-input 4.5.27 → 4.5.28-snapshot-1393ffa
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/Component.responsive.js +4 -3
- package/Component.responsive.js.map +1 -0
- package/components/date-time-input/Component.js +20 -21
- package/components/date-time-input/Component.js.map +1 -0
- package/components/date-time-input/index.css +11 -51
- package/components/date-time-input/index.js +3 -2
- package/components/date-time-input/index.js.map +1 -0
- package/components/date-time-input/index.module.css.js +8 -0
- package/components/date-time-input/index.module.css.js.map +1 -0
- package/cssm/Component.responsive.js +6 -5
- package/cssm/Component.responsive.js.map +1 -0
- package/cssm/components/date-time-input/Component.js +18 -17
- package/cssm/components/date-time-input/Component.js.map +1 -0
- package/cssm/components/date-time-input/index.js +3 -2
- package/cssm/components/date-time-input/index.js.map +1 -0
- package/cssm/components/date-time-input/index.module.css +5 -44
- package/cssm/desktop/Component.desktop.js +5 -4
- package/cssm/desktop/Component.desktop.js.map +1 -0
- package/cssm/desktop/index.js +3 -2
- package/cssm/desktop/index.js.map +1 -0
- package/cssm/index.js +1 -0
- package/cssm/index.js.map +1 -0
- package/cssm/mobile/Component.mobile.js +5 -4
- package/cssm/mobile/Component.mobile.js.map +1 -0
- package/cssm/mobile/index.js +3 -2
- package/cssm/mobile/index.js.map +1 -0
- package/{Component.responsive.d.ts → cssm/src/Component.responsive.d.ts} +5 -7
- package/cssm/{components → src/components}/date-time-input/Component.d.ts +10 -15
- package/cssm/src/components/date-time-input/index.d.ts +1 -0
- package/cssm/src/desktop/Component.desktop.d.ts +8 -0
- package/cssm/src/desktop/index.d.ts +1 -0
- package/cssm/src/index.d.ts +2 -0
- package/cssm/src/mobile/Component.mobile.d.ts +4 -0
- package/cssm/src/mobile/index.d.ts +1 -0
- package/cssm/src/utils/format.d.ts +12 -0
- package/cssm/src/utils/index.d.ts +1 -0
- package/cssm/utils/format.js +1 -0
- package/cssm/utils/format.js.map +1 -0
- package/cssm/utils/index.js +14 -13
- package/cssm/utils/index.js.map +1 -0
- package/desktop/Component.desktop.js +5 -4
- package/desktop/Component.desktop.js.map +1 -0
- package/desktop/index.js +3 -2
- package/desktop/index.js.map +1 -0
- package/esm/Component.responsive.js +1 -0
- package/esm/Component.responsive.js.map +1 -0
- package/esm/components/date-time-input/Component.js +2 -3
- package/esm/components/date-time-input/Component.js.map +1 -0
- package/esm/components/date-time-input/index.css +11 -51
- package/esm/components/date-time-input/index.js +1 -0
- package/esm/components/date-time-input/index.js.map +1 -0
- package/esm/components/date-time-input/index.module.css.js +6 -0
- package/esm/components/date-time-input/index.module.css.js.map +1 -0
- package/esm/desktop/Component.desktop.js +1 -0
- package/esm/desktop/Component.desktop.js.map +1 -0
- package/esm/desktop/index.js +1 -0
- package/esm/desktop/index.js.map +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -0
- package/esm/mobile/Component.mobile.js +1 -0
- package/esm/mobile/Component.mobile.js.map +1 -0
- package/esm/mobile/index.js +1 -0
- package/esm/mobile/index.js.map +1 -0
- package/esm/{Component.responsive.d.ts → src/Component.responsive.d.ts} +5 -7
- package/{components → esm/src/components}/date-time-input/Component.d.ts +10 -15
- package/esm/src/components/date-time-input/index.d.ts +1 -0
- package/esm/src/desktop/Component.desktop.d.ts +8 -0
- package/esm/src/desktop/index.d.ts +1 -0
- package/esm/src/index.d.ts +2 -0
- package/esm/src/mobile/Component.mobile.d.ts +4 -0
- package/esm/src/mobile/index.d.ts +1 -0
- package/esm/src/utils/format.d.ts +12 -0
- package/esm/src/utils/index.d.ts +1 -0
- package/esm/utils/format.js +1 -0
- package/esm/utils/format.js.map +1 -0
- package/esm/utils/index.js +1 -0
- package/esm/utils/index.js.map +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -0
- package/mobile/Component.mobile.js +5 -4
- package/mobile/Component.mobile.js.map +1 -0
- package/mobile/index.js +3 -2
- package/mobile/index.js.map +1 -0
- package/modern/Component.responsive.js +1 -0
- package/modern/Component.responsive.js.map +1 -0
- package/modern/components/date-time-input/Component.js +2 -3
- package/modern/components/date-time-input/Component.js.map +1 -0
- package/modern/components/date-time-input/index.css +11 -51
- package/modern/components/date-time-input/index.js +1 -0
- package/modern/components/date-time-input/index.js.map +1 -0
- package/modern/components/date-time-input/index.module.css.js +6 -0
- package/modern/components/date-time-input/index.module.css.js.map +1 -0
- package/modern/desktop/Component.desktop.js +1 -0
- package/modern/desktop/Component.desktop.js.map +1 -0
- package/modern/desktop/index.js +1 -0
- package/modern/desktop/index.js.map +1 -0
- package/modern/index.js +1 -0
- package/modern/index.js.map +1 -0
- package/modern/mobile/Component.mobile.js +1 -0
- package/modern/mobile/Component.mobile.js.map +1 -0
- package/modern/mobile/index.js +1 -0
- package/modern/mobile/index.js.map +1 -0
- package/modern/{Component.responsive.d.ts → src/Component.responsive.d.ts} +5 -7
- package/{esm → modern/src}/components/date-time-input/Component.d.ts +10 -15
- package/modern/src/components/date-time-input/index.d.ts +1 -0
- package/modern/src/desktop/Component.desktop.d.ts +8 -0
- package/modern/src/desktop/index.d.ts +1 -0
- package/modern/src/index.d.ts +2 -0
- package/modern/src/mobile/Component.mobile.d.ts +4 -0
- package/modern/src/mobile/index.d.ts +1 -0
- package/modern/src/utils/format.d.ts +12 -0
- package/modern/src/utils/index.d.ts +1 -0
- package/modern/utils/format.js +1 -0
- package/modern/utils/format.js.map +1 -0
- package/modern/utils/index.js +1 -0
- package/modern/utils/index.js.map +1 -0
- package/moderncssm/Component.responsive.js +1 -0
- package/moderncssm/Component.responsive.js.map +1 -0
- package/moderncssm/components/date-time-input/Component.js +1 -0
- package/moderncssm/components/date-time-input/Component.js.map +1 -0
- package/moderncssm/components/date-time-input/index.js +1 -0
- package/moderncssm/components/date-time-input/index.js.map +1 -0
- package/moderncssm/components/date-time-input/index.module.css +0 -21
- package/moderncssm/desktop/Component.desktop.js +1 -0
- package/moderncssm/desktop/Component.desktop.js.map +1 -0
- package/moderncssm/desktop/index.js +1 -0
- package/moderncssm/desktop/index.js.map +1 -0
- package/moderncssm/index.js +1 -0
- package/moderncssm/index.js.map +1 -0
- package/moderncssm/mobile/Component.mobile.js +1 -0
- package/moderncssm/mobile/Component.mobile.js.map +1 -0
- package/moderncssm/mobile/index.js +1 -0
- package/moderncssm/mobile/index.js.map +1 -0
- package/{cssm → moderncssm/src}/Component.responsive.d.ts +5 -7
- package/{modern → moderncssm/src}/components/date-time-input/Component.d.ts +10 -15
- package/moderncssm/src/components/date-time-input/index.d.ts +1 -0
- package/moderncssm/src/desktop/Component.desktop.d.ts +8 -0
- package/moderncssm/src/desktop/index.d.ts +1 -0
- package/moderncssm/src/index.d.ts +2 -0
- package/moderncssm/src/mobile/Component.mobile.d.ts +4 -0
- package/moderncssm/src/mobile/index.d.ts +1 -0
- package/moderncssm/src/utils/format.d.ts +12 -0
- package/moderncssm/src/utils/index.d.ts +1 -0
- package/moderncssm/utils/format.js +1 -0
- package/moderncssm/utils/format.js.map +1 -0
- package/moderncssm/utils/index.js +1 -0
- package/moderncssm/utils/index.js.map +1 -0
- package/package.json +9 -10
- package/src/Component.responsive.d.ts +25 -0
- package/src/components/date-time-input/Component.d.ts +214 -0
- package/src/components/date-time-input/index.d.ts +1 -0
- package/src/desktop/Component.desktop.d.ts +8 -0
- package/src/desktop/index.d.ts +1 -0
- package/src/index.d.ts +2 -0
- package/src/mobile/Component.mobile.d.ts +4 -0
- package/src/mobile/index.d.ts +1 -0
- package/src/utils/format.d.ts +12 -0
- package/src/utils/index.d.ts +1 -0
- package/utils/format.js +1 -0
- package/utils/format.js.map +1 -0
- package/utils/index.js +14 -13
- package/utils/index.js.map +1 -0
- package/components/date-time-input/index.d.ts +0 -1
- package/cssm/components/date-time-input/index.d.ts +0 -1
- package/cssm/desktop/Component.desktop.d.ts +0 -10
- package/cssm/desktop/index.d.ts +0 -2
- package/cssm/index.d.ts +0 -3
- package/cssm/mobile/Component.mobile.d.ts +0 -6
- package/cssm/mobile/index.d.ts +0 -2
- package/cssm/utils/format.d.ts +0 -13
- package/cssm/utils/index.d.ts +0 -1
- package/desktop/Component.desktop.d.ts +0 -10
- package/desktop/index.d.ts +0 -2
- package/esm/components/date-time-input/index.d.ts +0 -1
- package/esm/desktop/Component.desktop.d.ts +0 -10
- package/esm/desktop/index.d.ts +0 -2
- package/esm/index.d.ts +0 -3
- package/esm/mobile/Component.mobile.d.ts +0 -6
- package/esm/mobile/index.d.ts +0 -2
- package/esm/utils/format.d.ts +0 -13
- package/esm/utils/index.d.ts +0 -1
- package/index.d.ts +0 -3
- package/mobile/Component.mobile.d.ts +0 -6
- package/mobile/index.d.ts +0 -2
- package/modern/components/date-time-input/index.d.ts +0 -1
- package/modern/desktop/Component.desktop.d.ts +0 -10
- package/modern/desktop/index.d.ts +0 -2
- package/modern/index.d.ts +0 -3
- package/modern/mobile/Component.mobile.d.ts +0 -6
- package/modern/mobile/index.d.ts +0 -2
- package/modern/utils/format.d.ts +0 -13
- package/modern/utils/index.d.ts +0 -1
- package/moderncssm/Component.responsive.d.ts +0 -27
- package/moderncssm/components/date-time-input/Component.d.ts +0 -219
- package/moderncssm/components/date-time-input/index.d.ts +0 -1
- package/moderncssm/desktop/Component.desktop.d.ts +0 -10
- package/moderncssm/desktop/index.d.ts +0 -2
- package/moderncssm/index.d.ts +0 -3
- package/moderncssm/mobile/Component.mobile.d.ts +0 -6
- package/moderncssm/mobile/index.d.ts +0 -2
- package/moderncssm/utils/format.d.ts +0 -13
- package/moderncssm/utils/index.d.ts +0 -1
- package/utils/format.d.ts +0 -13
- package/utils/index.d.ts +0 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { PopoverProps } from "@alfalab/core-components-popover";
|
|
8
|
-
type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
1
|
+
import React, { ChangeEvent, ElementType } from 'react';
|
|
2
|
+
import type { CalendarDesktopProps } from '@alfalab/core-components-calendar/desktop';
|
|
3
|
+
import type { CalendarMobileProps } from '@alfalab/core-components-calendar/mobile';
|
|
4
|
+
import { InputProps } from '@alfalab/core-components-input';
|
|
5
|
+
import { PopoverProps } from '@alfalab/core-components-popover';
|
|
6
|
+
export declare type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
9
7
|
/**
|
|
10
8
|
* Дополнительный класс
|
|
11
9
|
*/
|
|
@@ -102,7 +100,7 @@ type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
|
102
100
|
*/
|
|
103
101
|
disableUserInput?: boolean;
|
|
104
102
|
};
|
|
105
|
-
declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
|
|
103
|
+
export declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
|
|
106
104
|
/**
|
|
107
105
|
* Дополнительный класс
|
|
108
106
|
*/
|
|
@@ -143,9 +141,7 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
143
141
|
calendarProps?: (CalendarDesktopProps & Record<string, unknown>) | ({
|
|
144
142
|
title?: string | undefined;
|
|
145
143
|
open: boolean;
|
|
146
|
-
onClose?: (() => void) | undefined;
|
|
147
|
-
* Дополнительный класс
|
|
148
|
-
*/
|
|
144
|
+
onClose?: (() => void) | undefined;
|
|
149
145
|
allowSelectionFromEmptyRange?: boolean | undefined;
|
|
150
146
|
hasHeader?: boolean | undefined;
|
|
151
147
|
onApply?: (() => void) | undefined;
|
|
@@ -157,7 +153,7 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
157
153
|
onMonthTitleClick?: ((event: React.MouseEvent<HTMLSpanElement, globalThis.MouseEvent>) => void) | undefined;
|
|
158
154
|
yearsAmount?: number | undefined;
|
|
159
155
|
scrollableContainer?: HTMLElement | undefined;
|
|
160
|
-
} & Omit<CalendarDesktopProps, ("className" | "dataTestId" | "
|
|
156
|
+
} & Omit<CalendarDesktopProps, ("className" | "dataTestId" | "defaultView" | "selectorView" | "rangeComplete" | "onMonthChange" | "onYearClick" | "onPeriodClick" | "hasHeader" | "responsive" | "showCurrentYearSelector") | ("headerClassName" | "contentClassName")> & Pick<CalendarDesktopProps, "className" | "dataTestId" | "defaultView" | "selectorView" | "rangeComplete" | "onMonthChange" | "onYearClick" | "onPeriodClick" | "hasHeader" | "responsive" | "showCurrentYearSelector"> & Record<string, unknown>) | undefined;
|
|
161
157
|
/**
|
|
162
158
|
* Месяц в календаре по умолчанию (timestamp)
|
|
163
159
|
*/
|
|
@@ -206,7 +202,7 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
206
202
|
/**
|
|
207
203
|
* Отображение компонента в мобильном или десктопном виде
|
|
208
204
|
*/
|
|
209
|
-
view?: "
|
|
205
|
+
view?: "mobile" | "desktop" | undefined;
|
|
210
206
|
/**
|
|
211
207
|
* Компонент инпута
|
|
212
208
|
*/
|
|
@@ -216,4 +212,3 @@ declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "o
|
|
|
216
212
|
*/
|
|
217
213
|
disableUserInput?: boolean | undefined;
|
|
218
214
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
219
|
-
export { DateTimeInputProps, DateTimeInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateTimeInputProps } from '../components/date-time-input/Component';
|
|
3
|
+
export declare type DateTimeInputDesktopProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* use UniversalDateInput instead
|
|
7
|
+
*/
|
|
8
|
+
export declare const DateTimeInputDesktop: React.ForwardRefExoticComponent<DateTimeInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component.desktop';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateTimeInputProps } from '../components/date-time-input/Component';
|
|
3
|
+
export declare type DateTimeInputMobileProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'>;
|
|
4
|
+
export declare const DateTimeInputMobile: React.ForwardRefExoticComponent<DateTimeInputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component.mobile';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DATE_FORMAT = "dd.MM.yyyy";
|
|
2
|
+
export declare const DATE_MASK: (string | RegExp)[];
|
|
3
|
+
export declare const DATE_WITH_TIME_LENGTH: number;
|
|
4
|
+
export declare const isCompleteDateInput: (input: string) => boolean;
|
|
5
|
+
export declare const parseDateString: (value: string, dateFormat?: string) => Date;
|
|
6
|
+
export declare const isValidTimeFormat: (value: string) => boolean;
|
|
7
|
+
export declare const isValid: (inputValue: string) => boolean;
|
|
8
|
+
export declare const format: (value: string) => string;
|
|
9
|
+
export declare const parseTimestampToDate: (timestamp: number) => string;
|
|
10
|
+
export declare const getDateWithoutTime: (value: string) => Date;
|
|
11
|
+
export declare const getFullDateTime: (value: string) => Date;
|
|
12
|
+
export declare const addTimeToDate: (value: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './format';
|
|
@@ -132,3 +132,4 @@ const addTimeToDate = (value) => {
|
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
export { DATE_FORMAT, DATE_MASK, DATE_WITH_TIME_LENGTH, addTimeToDate, format, getDateWithoutTime, getFullDateTime, isCompleteDateInput, isValid, isValidTimeFormat, parseDateString, parseTimestampToDate };
|
|
135
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sources":["../../../src/utils/format.ts"],"sourcesContent":["/* eslint-disable no-useless-escape */\n\nimport dateFnsIsValid from 'date-fns/isValid';\nimport parse from 'date-fns/parse';\n\nexport const DATE_FORMAT = 'dd.MM.yyyy';\nexport const DATE_MASK = [\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n ',',\n ' ',\n /\\d/,\n /\\d/,\n ':',\n /\\d/,\n /\\d/,\n];\n\nexport const DATE_WITH_TIME_LENGTH = DATE_MASK.length;\nexport const isCompleteDateInput = (input: string) => input.length === DATE_WITH_TIME_LENGTH;\nexport const parseDateString = (value: string, dateFormat = DATE_FORMAT) =>\n parse(value, dateFormat, new Date());\nexport const isValidTimeFormat = (value: string): boolean => {\n const timeArr = value.split(':');\n const hours = timeArr[0];\n const mins = timeArr[1];\n\n if (hours.length !== 2 || Number(hours) > 23) {\n return false;\n }\n\n if (mins.length !== 2 || Number(mins) > 59) {\n return false;\n }\n\n return true;\n};\n\nexport const isValid = (inputValue: string) => {\n const inputValueArr = inputValue.split(', ');\n const date = inputValueArr[0];\n const time = inputValueArr[1];\n\n return (\n !inputValue ||\n (isCompleteDateInput(inputValue) &&\n dateFnsIsValid(parseDateString(date)) &&\n isValidTimeFormat(time))\n );\n};\n\nexport const format = (value: string): string =>\n value\n .replace(/^(\\d\\d)(\\d)$/, '$1.$2') // 121 => 12.1\n .replace(/^(\\d\\d)\\.(\\d\\d)(\\d)$/, '$1.$2.$3') // 12.122 => 12.12.2\n .replace(/^(\\d\\d)\\d\\.(.*)/, '$1.$2') // 123.12.2005 => 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d)\\d\\.(.*)/, '$1.$2') // 12.123.2005 => 12.12.2005\n .replace(/\\.$/, '') // 12. => 12\n .replace(/\\ $/, '') // 1 2 => 12\n .replace(/\\:$/, '') // 1:2 => 12\n .replace(/^(\\d\\d)(\\d.*)/, '$1.$2') // 1212 => 12.12\n .replace(/^(\\d\\d.\\d\\d)(\\d.*)/, '$1.$2') // 12.122 => 12.12.2\n .replace(/^(\\d\\d\\.\\d\\d)(\\d\\d\\d\\d)/, '$1.$2') // 12.122005 => 12.12.2005\n .replace(/^(\\d\\d)(\\d\\d\\.\\d\\d\\d\\d)/, '$1.$2') // 1212.2005 => 12.12.2005\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d),/, '$1') // 12.12.2005 => 12.12.2005\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d)(\\d)/, '$1, $2') // 12.12.20050 => 12.12.2005, 0\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d),(\\d.*)/, '$1, $2') // 12.12.2005,00:00 => 12.12.2005, 00:00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d) (\\d.*)/, '$1, $2') // 12.12.2005 00:00 => 12.12.2005, 00:00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d)(\\d.*)/, '$1, $2') // 12.12.200500:00=> 12.12.2005, 00:00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d), (\\d\\d):/, '$1, $2') // 12.12.2005, 00: => 12.12.2005, 00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d), (\\d\\d)(\\d)/, '$1, $2:$3') // 12.12.2005, 000 => 12.12.2005, 00:0\n .replace(/^(\\d\\.\\d\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 1.12.2005123123 => 1.12.2005\n .replace(/^(\\d\\d\\.\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 01.2.20055125125 => 01.2.2005\n .replace(/^(\\d)\\.(\\d\\d)([0-9]*)\\.(\\d\\d\\d\\d)/, '$1.$2.$4') // 1.123123.2005 => 1.12.2005\n .replace(/^(\\d\\.\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 1.2.20055125125 => 1.2.2005\n .replace(/^(\\d\\d)\\.()\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3') // 01..2005123123 => 01..2005\n .replace(/^(\\d)\\.()\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3') // 1..2005123123 => 1..2005\n .replace(/^()\\.()\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3') // ..2005123123 => ..2005\n .replace(/^()\\.(\\d)\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3'); // .2.2005123123 => .2.2005\n\nexport const parseTimestampToDate = (timestamp: number): string => {\n const date = new Date(timestamp);\n const year = date.getFullYear();\n\n let month: number | string = date.getMonth() + 1;\n let day: number | string = date.getDate();\n\n if (month < 10) {\n month = `0${month}`;\n }\n if (day < 10) {\n day = `0${day}`;\n }\n\n return `${day}.${month}.${year}`;\n};\n\nexport const getDateWithoutTime = (value: string): Date => {\n const valueArr = value.split(', ');\n\n let day;\n let month;\n let year;\n\n if (valueArr[0]) {\n const date = valueArr[0].split('.');\n\n [day, month, year] = date;\n }\n\n const date = new Date();\n\n date.setFullYear(Number(year), Number(month) - 1, Number(day));\n date.setHours(0, 0, 0, 0);\n\n return date;\n};\n\nexport const getFullDateTime = (value: string): Date => {\n const valueArr = value.split(', ');\n\n let day;\n let month;\n let year;\n let hours;\n let mins;\n\n if (valueArr[0]) {\n const date = valueArr[0].split('.');\n\n [day, month, year] = date;\n }\n if (valueArr[1]) {\n const time = valueArr[1].split(':');\n\n hours = Number(time[0]);\n mins = Number(time[1]);\n }\n\n const fullDate = new Date();\n\n fullDate.setFullYear(Number(year), Number(month) - 1, Number(day));\n fullDate.setHours(Number(hours) || 0);\n fullDate.setMinutes(Number(mins) || 0);\n fullDate.setSeconds(0);\n fullDate.setMilliseconds(0);\n\n return fullDate;\n};\n\nexport const addTimeToDate = (value: string): string => {\n if (value.length === 10 && dateFnsIsValid(parseDateString(value))) {\n return `${value}, 00:00`;\n }\n\n return value;\n};\n"],"names":[],"mappings":";;;AAAA;AAKO,MAAM,WAAW,GAAG;AACd,MAAA,SAAS,GAAG;IACrB,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI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IAAA,OAAO,QAAQ;AACnB;AAEa,MAAA,aAAa,GAAG,CAAC,KAAa,KAAY;AACnD,IAAA,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE,IAAI,cAAc,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/D,OAAO,CAAA,EAAG,KAAK,CAAA,OAAA,CAAS;AAC3B;AAED,IAAA,OAAO,KAAK;AAChB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-date-time-input",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.28-snapshot-1393ffa",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,19 +16,18 @@
|
|
|
16
16
|
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@alfalab/core-components-calendar": "
|
|
20
|
-
"@alfalab/core-components-input": "
|
|
21
|
-
"@alfalab/core-components-icon-button": "
|
|
22
|
-
"@alfalab/core-components-mq": "
|
|
23
|
-
"@alfalab/core-components-popover": "
|
|
19
|
+
"@alfalab/core-components-calendar": "7.18.3-snapshot-1393ffa",
|
|
20
|
+
"@alfalab/core-components-input": "15.5.5-snapshot-1393ffa",
|
|
21
|
+
"@alfalab/core-components-icon-button": "6.11.11-snapshot-1393ffa",
|
|
22
|
+
"@alfalab/core-components-mq": "5.0.0-snapshot-1393ffa",
|
|
23
|
+
"@alfalab/core-components-popover": "7.0.0-snapshot-1393ffa",
|
|
24
24
|
"@alfalab/hooks": "^1.13.1",
|
|
25
25
|
"@alfalab/icons-glyph": "^2.210.0",
|
|
26
26
|
"classnames": "^2.5.1",
|
|
27
27
|
"date-fns": "^2.16.1",
|
|
28
28
|
"react-merge-refs": "^1.1.0",
|
|
29
|
-
"tslib": "^2.4.0"
|
|
30
|
-
"@alfalab/core-components-shared": "^0.16.0"
|
|
29
|
+
"tslib": "^2.4.0"
|
|
31
30
|
},
|
|
32
|
-
"themesVersion": "
|
|
33
|
-
"varsVersion": "9.20.
|
|
31
|
+
"themesVersion": "14.0.0-snapshot-1393ffa",
|
|
32
|
+
"varsVersion": "9.20.1-snapshot-1393ffa"
|
|
34
33
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateTimeInputProps } from './components/date-time-input/Component';
|
|
3
|
+
export declare type DateTimeInputResponsiveProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
6
|
+
* @default 1024
|
|
7
|
+
*/
|
|
8
|
+
breakpoint?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Версия, которая будет использоваться при серверном рендеринге
|
|
11
|
+
*/
|
|
12
|
+
client?: 'desktop' | 'mobile';
|
|
13
|
+
};
|
|
14
|
+
export declare type DateTimeInputMedia = 'desktop' | 'mobile';
|
|
15
|
+
export declare const DateTimeInputResponsive: React.ForwardRefExoticComponent<Omit<DateTimeInputProps, "view" | "InputComponent"> & {
|
|
16
|
+
/**
|
|
17
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
18
|
+
* @default 1024
|
|
19
|
+
*/
|
|
20
|
+
breakpoint?: number | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Версия, которая будет использоваться при серверном рендеринге
|
|
23
|
+
*/
|
|
24
|
+
client?: "mobile" | "desktop" | undefined;
|
|
25
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import React, { ChangeEvent, ElementType } from 'react';
|
|
2
|
+
import type { CalendarDesktopProps } from '@alfalab/core-components-calendar/desktop';
|
|
3
|
+
import type { CalendarMobileProps } from '@alfalab/core-components-calendar/mobile';
|
|
4
|
+
import { InputProps } from '@alfalab/core-components-input';
|
|
5
|
+
import { PopoverProps } from '@alfalab/core-components-popover';
|
|
6
|
+
export declare type DateTimeInputProps = Omit<InputProps, 'onChange'> & {
|
|
7
|
+
/**
|
|
8
|
+
* Дополнительный класс
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Дополнительный класс для инпута
|
|
13
|
+
*/
|
|
14
|
+
inputClassName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Дополнительный класс для поповера
|
|
17
|
+
*/
|
|
18
|
+
popoverClassName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Обработчик изменения значения
|
|
21
|
+
*/
|
|
22
|
+
picker?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Обработчик изменения значения
|
|
25
|
+
*/
|
|
26
|
+
onChange?: (event: ChangeEvent<HTMLInputElement> | null, payload: {
|
|
27
|
+
date: Date;
|
|
28
|
+
value: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Обработчик окончания ввода
|
|
32
|
+
*/
|
|
33
|
+
onComplete?: (event: ChangeEvent<HTMLInputElement> | null, payload: {
|
|
34
|
+
date: Date;
|
|
35
|
+
value: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Компонент календаря
|
|
39
|
+
*/
|
|
40
|
+
Calendar?: ElementType;
|
|
41
|
+
/**
|
|
42
|
+
* Доп. пропсы для календаря
|
|
43
|
+
*/
|
|
44
|
+
calendarProps?: (CalendarDesktopProps & Record<string, unknown>) | (CalendarMobileProps & Record<string, unknown>);
|
|
45
|
+
/**
|
|
46
|
+
* Месяц в календаре по умолчанию (timestamp)
|
|
47
|
+
*/
|
|
48
|
+
defaultMonth?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Минимальная дата, доступная для выбора (timestamp)
|
|
51
|
+
*/
|
|
52
|
+
minDate?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Максимальная дата, доступная для выбора (timestamp)
|
|
55
|
+
*/
|
|
56
|
+
maxDate?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Список событий
|
|
59
|
+
*/
|
|
60
|
+
events?: Array<Date | number>;
|
|
61
|
+
/**
|
|
62
|
+
* Список выходных
|
|
63
|
+
*/
|
|
64
|
+
offDays?: Array<Date | number>;
|
|
65
|
+
/**
|
|
66
|
+
* Состояние открытия по умолчанию
|
|
67
|
+
*/
|
|
68
|
+
defaultOpen?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Позиционирование поповера с календарем
|
|
71
|
+
*/
|
|
72
|
+
popoverPosition?: PopoverProps['position'];
|
|
73
|
+
/**
|
|
74
|
+
* z-index Popover
|
|
75
|
+
*/
|
|
76
|
+
zIndexPopover?: PopoverProps['zIndex'];
|
|
77
|
+
/**
|
|
78
|
+
* Запрещает поповеру менять свою позицию.
|
|
79
|
+
* Например, если места снизу недостаточно,то он все равно будет показан снизу
|
|
80
|
+
*/
|
|
81
|
+
preventFlip?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Календарь будет принимать ширину инпута
|
|
84
|
+
*/
|
|
85
|
+
useAnchorWidth?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Растягивает компонент на ширину контейнера
|
|
88
|
+
*/
|
|
89
|
+
block?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
92
|
+
*/
|
|
93
|
+
view?: 'desktop' | 'mobile';
|
|
94
|
+
/**
|
|
95
|
+
* Компонент инпута
|
|
96
|
+
*/
|
|
97
|
+
InputComponent?: ElementType;
|
|
98
|
+
/**
|
|
99
|
+
* Запретить ввод с клавиатуры
|
|
100
|
+
*/
|
|
101
|
+
disableUserInput?: boolean;
|
|
102
|
+
};
|
|
103
|
+
export declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange"> & {
|
|
104
|
+
/**
|
|
105
|
+
* Дополнительный класс
|
|
106
|
+
*/
|
|
107
|
+
className?: string | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Дополнительный класс для инпута
|
|
110
|
+
*/
|
|
111
|
+
inputClassName?: string | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Дополнительный класс для поповера
|
|
114
|
+
*/
|
|
115
|
+
popoverClassName?: string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Обработчик изменения значения
|
|
118
|
+
*/
|
|
119
|
+
picker?: boolean | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Обработчик изменения значения
|
|
122
|
+
*/
|
|
123
|
+
onChange?: ((event: ChangeEvent<HTMLInputElement> | null, payload: {
|
|
124
|
+
date: Date;
|
|
125
|
+
value: string;
|
|
126
|
+
}) => void) | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Обработчик окончания ввода
|
|
129
|
+
*/
|
|
130
|
+
onComplete?: ((event: ChangeEvent<HTMLInputElement> | null, payload: {
|
|
131
|
+
date: Date;
|
|
132
|
+
value: string;
|
|
133
|
+
}) => void) | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Компонент календаря
|
|
136
|
+
*/
|
|
137
|
+
Calendar?: React.ElementType<any> | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* Доп. пропсы для календаря
|
|
140
|
+
*/
|
|
141
|
+
calendarProps?: (CalendarDesktopProps & Record<string, unknown>) | ({
|
|
142
|
+
title?: string | undefined;
|
|
143
|
+
open: boolean;
|
|
144
|
+
onClose?: (() => void) | undefined;
|
|
145
|
+
allowSelectionFromEmptyRange?: boolean | undefined;
|
|
146
|
+
hasHeader?: boolean | undefined;
|
|
147
|
+
onApply?: (() => void) | undefined;
|
|
148
|
+
clickableMonth?: boolean | undefined;
|
|
149
|
+
cancelButtonContent?: string | undefined;
|
|
150
|
+
selectButtonContent?: string | undefined;
|
|
151
|
+
resetButtonContent?: string | undefined;
|
|
152
|
+
} & {
|
|
153
|
+
onMonthTitleClick?: ((event: React.MouseEvent<HTMLSpanElement, globalThis.MouseEvent>) => void) | undefined;
|
|
154
|
+
yearsAmount?: number | undefined;
|
|
155
|
+
scrollableContainer?: HTMLElement | undefined;
|
|
156
|
+
} & Omit<CalendarDesktopProps, ("className" | "dataTestId" | "defaultView" | "selectorView" | "rangeComplete" | "onMonthChange" | "onYearClick" | "onPeriodClick" | "hasHeader" | "responsive" | "showCurrentYearSelector") | ("headerClassName" | "contentClassName")> & Pick<CalendarDesktopProps, "className" | "dataTestId" | "defaultView" | "selectorView" | "rangeComplete" | "onMonthChange" | "onYearClick" | "onPeriodClick" | "hasHeader" | "responsive" | "showCurrentYearSelector"> & Record<string, unknown>) | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Месяц в календаре по умолчанию (timestamp)
|
|
159
|
+
*/
|
|
160
|
+
defaultMonth?: number | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* Минимальная дата, доступная для выбора (timestamp)
|
|
163
|
+
*/
|
|
164
|
+
minDate?: number | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Максимальная дата, доступная для выбора (timestamp)
|
|
167
|
+
*/
|
|
168
|
+
maxDate?: number | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* Список событий
|
|
171
|
+
*/
|
|
172
|
+
events?: (number | Date)[] | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Список выходных
|
|
175
|
+
*/
|
|
176
|
+
offDays?: (number | Date)[] | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* Состояние открытия по умолчанию
|
|
179
|
+
*/
|
|
180
|
+
defaultOpen?: boolean | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Позиционирование поповера с календарем
|
|
183
|
+
*/
|
|
184
|
+
popoverPosition?: PopoverProps['position'];
|
|
185
|
+
/**
|
|
186
|
+
* z-index Popover
|
|
187
|
+
*/
|
|
188
|
+
zIndexPopover?: PopoverProps['zIndex'];
|
|
189
|
+
/**
|
|
190
|
+
* Запрещает поповеру менять свою позицию.
|
|
191
|
+
* Например, если места снизу недостаточно,то он все равно будет показан снизу
|
|
192
|
+
*/
|
|
193
|
+
preventFlip?: boolean | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* Календарь будет принимать ширину инпута
|
|
196
|
+
*/
|
|
197
|
+
useAnchorWidth?: boolean | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Растягивает компонент на ширину контейнера
|
|
200
|
+
*/
|
|
201
|
+
block?: boolean | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Отображение компонента в мобильном или десктопном виде
|
|
204
|
+
*/
|
|
205
|
+
view?: "mobile" | "desktop" | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Компонент инпута
|
|
208
|
+
*/
|
|
209
|
+
InputComponent?: React.ElementType<any> | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Запретить ввод с клавиатуры
|
|
212
|
+
*/
|
|
213
|
+
disableUserInput?: boolean | undefined;
|
|
214
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateTimeInputProps } from '../components/date-time-input/Component';
|
|
3
|
+
export declare type DateTimeInputDesktopProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated
|
|
6
|
+
* use UniversalDateInput instead
|
|
7
|
+
*/
|
|
8
|
+
export declare const DateTimeInputDesktop: React.ForwardRefExoticComponent<DateTimeInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component.desktop';
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateTimeInputProps } from '../components/date-time-input/Component';
|
|
3
|
+
export declare type DateTimeInputMobileProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'>;
|
|
4
|
+
export declare const DateTimeInputMobile: React.ForwardRefExoticComponent<DateTimeInputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Component.mobile';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DATE_FORMAT = "dd.MM.yyyy";
|
|
2
|
+
export declare const DATE_MASK: (string | RegExp)[];
|
|
3
|
+
export declare const DATE_WITH_TIME_LENGTH: number;
|
|
4
|
+
export declare const isCompleteDateInput: (input: string) => boolean;
|
|
5
|
+
export declare const parseDateString: (value: string, dateFormat?: string) => Date;
|
|
6
|
+
export declare const isValidTimeFormat: (value: string) => boolean;
|
|
7
|
+
export declare const isValid: (inputValue: string) => boolean;
|
|
8
|
+
export declare const format: (value: string) => string;
|
|
9
|
+
export declare const parseTimestampToDate: (timestamp: number) => string;
|
|
10
|
+
export declare const getDateWithoutTime: (value: string) => Date;
|
|
11
|
+
export declare const getFullDateTime: (value: string) => Date;
|
|
12
|
+
export declare const addTimeToDate: (value: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './format';
|
package/utils/format.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sources":["../../src/utils/format.ts"],"sourcesContent":["/* eslint-disable no-useless-escape */\n\nimport dateFnsIsValid from 'date-fns/isValid';\nimport parse from 'date-fns/parse';\n\nexport const DATE_FORMAT = 'dd.MM.yyyy';\nexport const DATE_MASK = [\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n ',',\n ' ',\n /\\d/,\n /\\d/,\n ':',\n /\\d/,\n /\\d/,\n];\n\nexport const DATE_WITH_TIME_LENGTH = DATE_MASK.length;\nexport const isCompleteDateInput = (input: string) => input.length === DATE_WITH_TIME_LENGTH;\nexport const parseDateString = (value: string, dateFormat = DATE_FORMAT) =>\n parse(value, dateFormat, new Date());\nexport const isValidTimeFormat = (value: string): boolean => {\n const timeArr = value.split(':');\n const hours = timeArr[0];\n const mins = timeArr[1];\n\n if (hours.length !== 2 || Number(hours) > 23) {\n return false;\n }\n\n if (mins.length !== 2 || Number(mins) > 59) {\n return false;\n }\n\n return true;\n};\n\nexport const isValid = (inputValue: string) => {\n const inputValueArr = inputValue.split(', ');\n const date = inputValueArr[0];\n const time = inputValueArr[1];\n\n return (\n !inputValue ||\n (isCompleteDateInput(inputValue) &&\n dateFnsIsValid(parseDateString(date)) &&\n isValidTimeFormat(time))\n );\n};\n\nexport const format = (value: string): string =>\n value\n .replace(/^(\\d\\d)(\\d)$/, '$1.$2') // 121 => 12.1\n .replace(/^(\\d\\d)\\.(\\d\\d)(\\d)$/, '$1.$2.$3') // 12.122 => 12.12.2\n .replace(/^(\\d\\d)\\d\\.(.*)/, '$1.$2') // 123.12.2005 => 12.12.2005\n .replace(/^(\\d\\d\\.\\d\\d)\\d\\.(.*)/, '$1.$2') // 12.123.2005 => 12.12.2005\n .replace(/\\.$/, '') // 12. => 12\n .replace(/\\ $/, '') // 1 2 => 12\n .replace(/\\:$/, '') // 1:2 => 12\n .replace(/^(\\d\\d)(\\d.*)/, '$1.$2') // 1212 => 12.12\n .replace(/^(\\d\\d.\\d\\d)(\\d.*)/, '$1.$2') // 12.122 => 12.12.2\n .replace(/^(\\d\\d\\.\\d\\d)(\\d\\d\\d\\d)/, '$1.$2') // 12.122005 => 12.12.2005\n .replace(/^(\\d\\d)(\\d\\d\\.\\d\\d\\d\\d)/, '$1.$2') // 1212.2005 => 12.12.2005\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d),/, '$1') // 12.12.2005 => 12.12.2005\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d)(\\d)/, '$1, $2') // 12.12.20050 => 12.12.2005, 0\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d),(\\d.*)/, '$1, $2') // 12.12.2005,00:00 => 12.12.2005, 00:00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d) (\\d.*)/, '$1, $2') // 12.12.2005 00:00 => 12.12.2005, 00:00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d)(\\d.*)/, '$1, $2') // 12.12.200500:00=> 12.12.2005, 00:00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d), (\\d\\d):/, '$1, $2') // 12.12.2005, 00: => 12.12.2005, 00\n .replace(/^(\\d\\d.\\d\\d\\.\\d\\d\\d\\d), (\\d\\d)(\\d)/, '$1, $2:$3') // 12.12.2005, 000 => 12.12.2005, 00:0\n .replace(/^(\\d\\.\\d\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 1.12.2005123123 => 1.12.2005\n .replace(/^(\\d\\d\\.\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 01.2.20055125125 => 01.2.2005\n .replace(/^(\\d)\\.(\\d\\d)([0-9]*)\\.(\\d\\d\\d\\d)/, '$1.$2.$4') // 1.123123.2005 => 1.12.2005\n .replace(/^(\\d\\.\\d\\.\\d\\d\\d\\d)([0-9]*)/, '$1') // 1.2.20055125125 => 1.2.2005\n .replace(/^(\\d\\d)\\.()\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3') // 01..2005123123 => 01..2005\n .replace(/^(\\d)\\.()\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3') // 1..2005123123 => 1..2005\n .replace(/^()\\.()\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3') // ..2005123123 => ..2005\n .replace(/^()\\.(\\d)\\.(\\d\\d\\d\\d)([0-9]*)/, '$1.$2.$3'); // .2.2005123123 => .2.2005\n\nexport const parseTimestampToDate = (timestamp: number): string => {\n const date = new Date(timestamp);\n const year = date.getFullYear();\n\n let month: number | string = date.getMonth() + 1;\n let day: number | string = date.getDate();\n\n if (month < 10) {\n month = `0${month}`;\n }\n if (day < 10) {\n day = `0${day}`;\n }\n\n return `${day}.${month}.${year}`;\n};\n\nexport const getDateWithoutTime = (value: string): Date => {\n const valueArr = value.split(', ');\n\n let day;\n let month;\n let year;\n\n if (valueArr[0]) {\n const date = valueArr[0].split('.');\n\n [day, month, year] = date;\n }\n\n const date = new Date();\n\n date.setFullYear(Number(year), Number(month) - 1, Number(day));\n date.setHours(0, 0, 0, 0);\n\n return date;\n};\n\nexport const getFullDateTime = (value: string): Date => {\n const valueArr = value.split(', ');\n\n let day;\n let month;\n let year;\n let hours;\n let mins;\n\n if (valueArr[0]) {\n const date = valueArr[0].split('.');\n\n [day, month, year] = date;\n }\n if (valueArr[1]) {\n const time = valueArr[1].split(':');\n\n hours = Number(time[0]);\n mins = Number(time[1]);\n }\n\n const fullDate = new Date();\n\n fullDate.setFullYear(Number(year), Number(month) - 1, Number(day));\n fullDate.setHours(Number(hours) || 0);\n fullDate.setMinutes(Number(mins) || 0);\n fullDate.setSeconds(0);\n fullDate.setMilliseconds(0);\n\n return fullDate;\n};\n\nexport const addTimeToDate = (value: string): string => {\n if (value.length === 10 && dateFnsIsValid(parseDateString(value))) {\n return `${value}, 00:00`;\n }\n\n return value;\n};\n"],"names":["parse","dateFnsIsValid"],"mappings":";;;;;;;;;;;;AAAA;AAKO,IAAM,WAAW,GAAG;AACd,IAAA,SAAS,GAAG;IACrB,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,IAAI;;AAGK,IAAA,qBAAqB,GAAG,SAAS,CAAC;AACxC,IAAM,mBAAmB,GAAG,UAAC,KAAa,EAAA,EAAK,OAAA,KAAK,CAAC,MAAM,KAAK,qBAAqB,CAAA;AAC/E,IAAA,eAAe,GAAG,UAAC,KAAa,EAAE,UAAwB,EAAA;AAAxB,IAAA,IAAA,UAAA,KAAA,MAAA,EAAA,EAAA,UAAwB,GAAA,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A,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE,IAAIA,+BAAc,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/D,OAAO,EAAA,CAAA,MAAA,CAAG,KAAK,EAAA,SAAA,CAAS;AAC3B;AAED,IAAA,OAAO,KAAK;AAChB;;;;;;;;;;;;;;;"}
|
package/utils/index.js
CHANGED
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var format = require('./format.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.DATE_FORMAT =
|
|
10
|
-
exports.DATE_MASK =
|
|
11
|
-
exports.DATE_WITH_TIME_LENGTH =
|
|
12
|
-
exports.addTimeToDate =
|
|
13
|
-
exports.format =
|
|
14
|
-
exports.getDateWithoutTime =
|
|
15
|
-
exports.getFullDateTime =
|
|
16
|
-
exports.isCompleteDateInput =
|
|
17
|
-
exports.isValid =
|
|
18
|
-
exports.isValidTimeFormat =
|
|
19
|
-
exports.parseDateString =
|
|
20
|
-
exports.parseTimestampToDate =
|
|
9
|
+
exports.DATE_FORMAT = format.DATE_FORMAT;
|
|
10
|
+
exports.DATE_MASK = format.DATE_MASK;
|
|
11
|
+
exports.DATE_WITH_TIME_LENGTH = format.DATE_WITH_TIME_LENGTH;
|
|
12
|
+
exports.addTimeToDate = format.addTimeToDate;
|
|
13
|
+
exports.format = format.format;
|
|
14
|
+
exports.getDateWithoutTime = format.getDateWithoutTime;
|
|
15
|
+
exports.getFullDateTime = format.getFullDateTime;
|
|
16
|
+
exports.isCompleteDateInput = format.isCompleteDateInput;
|
|
17
|
+
exports.isValid = format.isValid;
|
|
18
|
+
exports.isValidTimeFormat = format.isValidTimeFormat;
|
|
19
|
+
exports.parseDateString = format.parseDateString;
|
|
20
|
+
exports.parseTimestampToDate = format.parseTimestampToDate;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Component";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Component";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { DateTimeInputProps } from "../components/date-time-input/Component";
|
|
4
|
-
type DateTimeInputDesktopProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'>;
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated
|
|
7
|
-
* use UniversalDateInput instead
|
|
8
|
-
*/
|
|
9
|
-
declare const DateTimeInputDesktop: React.ForwardRefExoticComponent<DateTimeInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
-
export { DateTimeInputDesktopProps, DateTimeInputDesktop };
|
package/cssm/desktop/index.d.ts
DELETED
package/cssm/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { DateTimeInputProps } from "../components/date-time-input/Component";
|
|
4
|
-
type DateTimeInputMobileProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'>;
|
|
5
|
-
declare const DateTimeInputMobile: React.ForwardRefExoticComponent<DateTimeInputMobileProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
-
export { DateTimeInputMobileProps, DateTimeInputMobile };
|
package/cssm/mobile/index.d.ts
DELETED
package/cssm/utils/format.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const DATE_FORMAT = "dd.MM.yyyy";
|
|
2
|
-
declare const DATE_MASK: (string | RegExp)[];
|
|
3
|
-
declare const DATE_WITH_TIME_LENGTH: number;
|
|
4
|
-
declare const isCompleteDateInput: (input: string) => boolean;
|
|
5
|
-
declare const parseDateString: (value: string, dateFormat?: string) => Date;
|
|
6
|
-
declare const isValidTimeFormat: (value: string) => boolean;
|
|
7
|
-
declare const isValid: (inputValue: string) => boolean;
|
|
8
|
-
declare const format: (value: string) => string;
|
|
9
|
-
declare const parseTimestampToDate: (timestamp: number) => string;
|
|
10
|
-
declare const getDateWithoutTime: (value: string) => Date;
|
|
11
|
-
declare const getFullDateTime: (value: string) => Date;
|
|
12
|
-
declare const addTimeToDate: (value: string) => string;
|
|
13
|
-
export { DATE_FORMAT, DATE_MASK, DATE_WITH_TIME_LENGTH, isCompleteDateInput, parseDateString, isValidTimeFormat, isValid, format, parseTimestampToDate, getDateWithoutTime, getFullDateTime, addTimeToDate };
|
package/cssm/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./format";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { DateTimeInputProps } from "../components/date-time-input/Component";
|
|
4
|
-
type DateTimeInputDesktopProps = Omit<DateTimeInputProps, 'view' | 'InputComponent'>;
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated
|
|
7
|
-
* use UniversalDateInput instead
|
|
8
|
-
*/
|
|
9
|
-
declare const DateTimeInputDesktop: React.ForwardRefExoticComponent<DateTimeInputDesktopProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
-
export { DateTimeInputDesktopProps, DateTimeInputDesktop };
|
package/desktop/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Component";
|