@astral/ui 0.31.0 → 0.32.2
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/ButtonBase/ButtonBase.d.ts +1 -1
- package/ButtonBase/ButtonBase.js +4 -4
- package/ContentState/ContentState.d.ts +35 -0
- package/ContentState/ContentState.js +33 -0
- package/ContentState/index.d.ts +2 -0
- package/ContentState/index.js +14 -0
- package/ContentState/types.d.ts +27 -0
- package/ContentState/types.js +2 -0
- package/DatePicker/DatePicker.d.ts +10 -2
- package/DatePicker/DatePicker.js +41 -38
- package/DatePicker/DatePickerDay/DatePickerDay.d.ts +7 -0
- package/DatePicker/DatePickerDay/DatePickerDay.js +20 -0
- package/DatePicker/DatePickerDay/index.d.ts +1 -0
- package/DatePicker/DatePickerDay/index.js +5 -0
- package/DatePicker/DatePickerDay/styled.d.ts +4 -0
- package/DatePicker/DatePickerDay/styled.js +11 -0
- package/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +3 -0
- package/DatePicker/DatePickerHeader/DatePickerHeader.js +31 -0
- package/DatePicker/DatePickerHeader/index.d.ts +1 -0
- package/DatePicker/DatePickerHeader/index.js +5 -0
- package/DatePicker/DatePickerHeader/styled.d.ts +20 -0
- package/DatePicker/DatePickerHeader/styled.js +12 -0
- package/DatePicker/index.d.ts +1 -0
- package/DatePicker/index.js +1 -0
- package/DatePicker/styled.d.ts +5 -0
- package/DatePicker/styled.js +73 -0
- package/DatePicker/types.d.ts +0 -2
- package/DatePickerProvider/DatePickerProvider.d.ts +13 -0
- package/DatePickerProvider/DatePickerProvider.js +26 -0
- package/DatePickerProvider/index.d.ts +1 -0
- package/DatePickerProvider/index.js +13 -0
- package/DropdownButton/DropdownButton.d.ts +9 -0
- package/DropdownButton/DropdownButton.js +37 -0
- package/DropdownButton/index.d.ts +1 -0
- package/DropdownButton/index.js +13 -0
- package/DropdownButton/styles.d.ts +11 -0
- package/DropdownButton/styles.js +28 -0
- package/GlobalStyles/GlobalStyles.js +11 -0
- package/IconButton/IconButton.d.ts +1 -1
- package/IconButton/IconButton.js +4 -4
- package/IconButton/styled.d.ts +1 -5
- package/IconDropdownButton/IconDropdownButton.d.ts +9 -0
- package/IconDropdownButton/IconDropdownButton.js +36 -0
- package/IconDropdownButton/index.d.ts +1 -0
- package/IconDropdownButton/index.js +13 -0
- package/IconDropdownButton/styles.d.ts +11 -0
- package/IconDropdownButton/styles.js +19 -0
- package/MaskField/MaskField.d.ts +13 -1
- package/MaskField/MaskField.js +5 -2
- package/MaskField/types.d.ts +0 -7
- package/Menu/Menu.d.ts +3 -3
- package/Menu/Menu.js +2 -20
- package/Notification/NotificationTemplate/styled.d.ts +1 -5
- package/Placeholder/styled.js +1 -1
- package/Profile/Profile.js +3 -14
- package/esm/ButtonBase/ButtonBase.d.ts +1 -1
- package/esm/ButtonBase/ButtonBase.js +4 -3
- package/esm/ContentState/ContentState.d.ts +35 -0
- package/esm/ContentState/ContentState.js +29 -0
- package/esm/ContentState/index.d.ts +2 -0
- package/esm/ContentState/index.js +2 -0
- package/esm/ContentState/types.d.ts +27 -0
- package/esm/ContentState/types.js +1 -0
- package/esm/DatePicker/DatePicker.d.ts +10 -2
- package/esm/DatePicker/DatePicker.js +39 -39
- package/esm/DatePicker/DatePickerDay/DatePickerDay.d.ts +7 -0
- package/esm/DatePicker/DatePickerDay/DatePickerDay.js +16 -0
- package/esm/DatePicker/DatePickerDay/index.d.ts +1 -0
- package/esm/DatePicker/DatePickerDay/index.js +1 -0
- package/esm/DatePicker/DatePickerDay/styled.d.ts +4 -0
- package/esm/DatePicker/DatePickerDay/styled.js +8 -0
- package/esm/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +3 -0
- package/esm/DatePicker/DatePickerHeader/DatePickerHeader.js +24 -0
- package/esm/DatePicker/DatePickerHeader/index.d.ts +1 -0
- package/esm/DatePicker/DatePickerHeader/index.js +1 -0
- package/esm/DatePicker/DatePickerHeader/styled.d.ts +20 -0
- package/esm/DatePicker/DatePickerHeader/styled.js +9 -0
- package/esm/DatePicker/index.d.ts +1 -0
- package/esm/DatePicker/index.js +1 -0
- package/esm/DatePicker/styled.d.ts +5 -0
- package/esm/DatePicker/styled.js +70 -0
- package/esm/DatePicker/types.d.ts +0 -2
- package/esm/DatePickerProvider/DatePickerProvider.d.ts +13 -0
- package/esm/DatePickerProvider/DatePickerProvider.js +19 -0
- package/esm/DatePickerProvider/index.d.ts +1 -0
- package/esm/DatePickerProvider/index.js +1 -0
- package/esm/DropdownButton/DropdownButton.d.ts +9 -0
- package/esm/DropdownButton/DropdownButton.js +34 -0
- package/esm/DropdownButton/index.d.ts +1 -0
- package/esm/DropdownButton/index.js +1 -0
- package/esm/DropdownButton/styles.d.ts +11 -0
- package/esm/DropdownButton/styles.js +25 -0
- package/esm/GlobalStyles/GlobalStyles.js +11 -0
- package/esm/IconButton/IconButton.d.ts +1 -1
- package/esm/IconButton/IconButton.js +4 -3
- package/esm/IconButton/styled.d.ts +1 -5
- package/esm/IconDropdownButton/IconDropdownButton.d.ts +9 -0
- package/esm/IconDropdownButton/IconDropdownButton.js +33 -0
- package/esm/IconDropdownButton/index.d.ts +1 -0
- package/esm/IconDropdownButton/index.js +1 -0
- package/esm/IconDropdownButton/styles.d.ts +11 -0
- package/esm/IconDropdownButton/styles.js +16 -0
- package/esm/MaskField/MaskField.d.ts +13 -1
- package/esm/MaskField/MaskField.js +5 -2
- package/esm/MaskField/types.d.ts +0 -7
- package/esm/Menu/Menu.d.ts +3 -3
- package/esm/Menu/Menu.js +2 -16
- package/esm/Notification/NotificationTemplate/styled.d.ts +1 -5
- package/esm/Placeholder/styled.js +1 -1
- package/esm/Profile/Profile.js +4 -15
- package/esm/hooks/index.d.ts +1 -0
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useMenu.d.ts +21 -0
- package/esm/hooks/useMenu.js +8 -0
- package/esm/index.d.ts +6 -1
- package/esm/index.js +6 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +13 -0
- package/hooks/useMenu.d.ts +21 -0
- package/hooks/useMenu.js +12 -0
- package/index.d.ts +6 -1
- package/index.js +6 -1
- package/package.json +5 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseButtonProps } from './types';
|
|
3
|
-
export declare const ButtonBase: (
|
|
3
|
+
export declare const ButtonBase: import("react").ForwardRefExoticComponent<Pick<BaseButtonProps, keyof import("@mui/base").ButtonUnstyledOwnProps | "form" | "slot" | "style" | "title" | "key" | "css" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "variant"> & import("react").RefAttributes<HTMLButtonElement>>;
|
package/ButtonBase/ButtonBase.js
CHANGED
|
@@ -24,10 +24,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.ButtonBase = void 0;
|
|
26
26
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var react_1 = require("react");
|
|
27
28
|
var constants_1 = require("./constants");
|
|
28
29
|
var styled_1 = require("./styled");
|
|
29
|
-
|
|
30
|
+
exports.ButtonBase = (0, react_1.forwardRef)(function (_a, ref) {
|
|
30
31
|
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? constants_1.ButtonVariants.CONTAINED : _b, _c = _a.color, color = _c === void 0 ? constants_1.ButtonColors.PRIMARY : _c, props = __rest(_a, ["children", "variant", "color"]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(styled_1.StyledButtonBase, __assign({}, props, { customColor: color, customVariant: variant }, { children: children }), void 0));
|
|
32
|
-
};
|
|
33
|
-
exports.ButtonBase = ButtonBase;
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(styled_1.StyledButtonBase, __assign({ ref: ref }, props, { customColor: color, customVariant: variant }, { children: children }), void 0));
|
|
33
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PlaceholderProps } from '../Placeholder/types';
|
|
3
|
+
import { ContentStateErrorProps } from './types';
|
|
4
|
+
declare type ContentStateProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Флаг состояния загрузки
|
|
7
|
+
*/
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Элемент для отображения состояния загрузки
|
|
11
|
+
*/
|
|
12
|
+
loadingContent?: JSX.Element | string;
|
|
13
|
+
/**
|
|
14
|
+
* Флаг состояния ошибки
|
|
15
|
+
*/
|
|
16
|
+
isError?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Параметры для отображения состояния ошибки
|
|
19
|
+
*/
|
|
20
|
+
errorState?: ContentStateErrorProps;
|
|
21
|
+
/**
|
|
22
|
+
* Флаг для отображения custom состояния ошибки
|
|
23
|
+
*/
|
|
24
|
+
isCustom?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Параметры для отображения custom состояния ошибки
|
|
27
|
+
*/
|
|
28
|
+
customState?: PlaceholderProps;
|
|
29
|
+
/**
|
|
30
|
+
* Элементы для отображения состояния "Успех"
|
|
31
|
+
*/
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export declare const ContentState: (props: ContentStateProps) => JSX.Element;
|
|
35
|
+
export default ContentState;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ContentState = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var react_1 = require("react");
|
|
17
|
+
var __1 = require("..");
|
|
18
|
+
var ContentState = function (props) {
|
|
19
|
+
var isLoading = props.isLoading, _a = props.loadingContent, LoadingContent = _a === void 0 ? (0, jsx_runtime_1.jsx)(__1.CircularProgress, { color: "primary" }, void 0) : _a, isError = props.isError, errorState = props.errorState, isCustom = props.isCustom, customState = props.customState, children = props.children;
|
|
20
|
+
if (isLoading)
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: LoadingContent }, void 0);
|
|
22
|
+
if (isCustom && customState) {
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(__1.Placeholder, __assign({}, customState), void 0);
|
|
24
|
+
}
|
|
25
|
+
if (isError && errorState) {
|
|
26
|
+
var _b = errorState.title, title = _b === void 0 ? 'Произошла ошибка' : _b, imgAlt = errorState.imgAlt, imgSrc = errorState.imgSrc, errorList = errorState.errorList, onRetry = errorState.onRetry, _c = errorState.actions, actions = _c === void 0 ? (0, jsx_runtime_1.jsx)(__1.Button, __assign({ onClick: onRetry }, { children: "\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430" }), void 0) : _c;
|
|
27
|
+
var description = errorList.map(function (item, index) { return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(__1.Typography, __assign({ component: "span" }, { children: item }), void 0), (0, jsx_runtime_1.jsx)("br", {}, void 0)] }, index)); });
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(__1.Placeholder, { title: title, description: description, imgAlt: imgAlt, imgSrc: imgSrc, Actions: actions }, void 0));
|
|
29
|
+
}
|
|
30
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: children }, void 0);
|
|
31
|
+
};
|
|
32
|
+
exports.ContentState = ContentState;
|
|
33
|
+
exports.default = exports.ContentState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./ContentState"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type ContentStateErrorProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Название ошибки
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Изображение ошибки
|
|
9
|
+
*/
|
|
10
|
+
imgSrc: string;
|
|
11
|
+
/**
|
|
12
|
+
* Alt атрибут для изображения
|
|
13
|
+
*/
|
|
14
|
+
imgAlt: string;
|
|
15
|
+
/**
|
|
16
|
+
* Список ошибок для отображения
|
|
17
|
+
*/
|
|
18
|
+
errorList: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Элементы кнопок для дальнейших действий
|
|
21
|
+
*/
|
|
22
|
+
actions?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Функция для повторного действия
|
|
25
|
+
*/
|
|
26
|
+
onRetry: () => void;
|
|
27
|
+
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ReactDatePickerProps } from 'react-datepicker';
|
|
3
|
+
import { TextFieldProps } from '../TextField';
|
|
4
|
+
export declare type DatePickerProps = Omit<ReactDatePickerProps, 'renderCustomHeader' | 'locale' | 'renderCustomHeader' | 'renderDayContents' | 'customInput' | 'selected' | 'value' | 'placeholderText'> & {
|
|
5
|
+
inputProps?: TextFieldProps;
|
|
6
|
+
value?: Date;
|
|
7
|
+
};
|
|
8
|
+
export declare const DatePicker: import("react").ForwardRefExoticComponent<Omit<ReactDatePickerProps<never, undefined>, "value" | "selected" | "locale" | "renderCustomHeader" | "renderDayContents" | "customInput" | "placeholderText"> & {
|
|
9
|
+
inputProps?: TextFieldProps | undefined;
|
|
10
|
+
value?: Date | undefined;
|
|
11
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
4
12
|
export default DatePicker;
|
package/DatePicker/DatePicker.js
CHANGED
|
@@ -21,50 +21,53 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
}
|
|
22
22
|
return t;
|
|
23
23
|
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
24
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
28
|
exports.DatePicker = void 0;
|
|
26
29
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
30
|
var react_1 = require("react");
|
|
28
|
-
var
|
|
31
|
+
var react_datepicker_1 = __importDefault(require("react-datepicker"));
|
|
32
|
+
var material_1 = require("@mui/material");
|
|
29
33
|
var icons_1 = require("@astral/icons");
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
leftArrowButton: {
|
|
39
|
-
sx: {
|
|
40
|
-
padding: 1,
|
|
41
|
-
borderRadius: 1,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
rightArrowButton: {
|
|
45
|
-
sx: {
|
|
46
|
-
padding: 1,
|
|
47
|
-
borderRadius: 1,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
};
|
|
34
|
+
var date_fns_1 = require("date-fns");
|
|
35
|
+
var MaskField_1 = require("../MaskField");
|
|
36
|
+
var DatePickerProvider_1 = require("../DatePickerProvider");
|
|
37
|
+
var styled_1 = require("./styled");
|
|
38
|
+
var DatePickerHeader_1 = require("./DatePickerHeader");
|
|
39
|
+
var DatePickerDay_1 = require("./DatePickerDay");
|
|
40
|
+
var MIN_YEAR = 1000;
|
|
51
41
|
exports.DatePicker = (0, react_1.forwardRef)(function (props, ref) {
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
var value = props.value, onChange = props.onChange, _a = props.inputProps, inputProps = _a === void 0 ? {} : _a, _b = props.dateFormat, dateFormat = _b === void 0 ? 'dd.MM.yyyy' : _b, restProps = __rest(props, ["value", "onChange", "inputProps", "dateFormat"]);
|
|
43
|
+
var placeholder = inputProps.placeholder, restInputProps = __rest(inputProps, ["placeholder"]);
|
|
44
|
+
var locale = (0, react_1.useContext)(DatePickerProvider_1.DatePickerContext).locale;
|
|
45
|
+
// уберкостыль, react-date-picker забирает значение из event.target.value
|
|
46
|
+
var handleMaskFieldAccept = function (val, _maskRef, _e, onMaskFieldChange) {
|
|
47
|
+
onMaskFieldChange === null || onMaskFieldChange === void 0 ? void 0 : onMaskFieldChange({
|
|
48
|
+
target: {
|
|
49
|
+
value: val,
|
|
60
50
|
},
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
var handleChangeRaw = function (e) {
|
|
54
|
+
var date = (0, date_fns_1.parse)(e === null || e === void 0 ? void 0 : e.target.value, dateFormat, new Date());
|
|
55
|
+
// если инпут пустой - кладем в value null
|
|
56
|
+
if (!(e === null || e === void 0 ? void 0 : e.target.value)) {
|
|
57
|
+
onChange(null, e);
|
|
58
|
+
}
|
|
59
|
+
if ((0, date_fns_1.isValid)(date) && date.getFullYear() >= MIN_YEAR) {
|
|
60
|
+
onChange(date, e);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(styled_1.DatePickerWrapper, { children: (0, jsx_runtime_1.jsx)(react_datepicker_1.default, __assign({}, restProps, { locale: locale, selected: value, openToDate: value !== null && value !== void 0 ? value : undefined, dateFormat: dateFormat, placeholderText: placeholder, onChange: onChange, onChangeRaw: handleChangeRaw, renderCustomHeader: function (renderProps) { return ((0, jsx_runtime_1.jsx)(DatePickerHeader_1.DatePickerHeader, __assign({}, renderProps), void 0)); }, renderDayContents: function (dayOfMonth) { return ((0, jsx_runtime_1.jsx)(DatePickerDay_1.DatePickerDay, { dayOfMonth: dayOfMonth }, void 0)); }, customInput: (0, jsx_runtime_1.jsx)(MaskField_1.MaskField, __assign({}, restInputProps, { mask: Date, autofix: "pad", onAccept: handleMaskFieldAccept, InputProps: {
|
|
64
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, __assign({ position: "end" }, { children: (0, jsx_runtime_1.jsx)(icons_1.CalendarOutlineMd, {}, void 0) }), void 0)),
|
|
65
|
+
}, inputRef: function (el) {
|
|
66
|
+
// если передан ref - пишем в ref.current элемент из MaskField (inputRef принимает только функцию)
|
|
67
|
+
if (ref) {
|
|
68
|
+
ref.current =
|
|
69
|
+
el;
|
|
70
|
+
}
|
|
71
|
+
} }), void 0) }), void 0) }, void 0));
|
|
69
72
|
});
|
|
70
73
|
exports.default = exports.DatePicker;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.DatePickerDay = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var styled_1 = require("./styled");
|
|
17
|
+
var DatePickerDay = function (props) {
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(styled_1.DatePickerDayButton, __assign({ variant: "text" }, { children: props.dayOfMonth }), void 0));
|
|
19
|
+
};
|
|
20
|
+
exports.DatePickerDay = DatePickerDay;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePickerDay } from './DatePickerDay';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatePickerDay = void 0;
|
|
4
|
+
var DatePickerDay_1 = require("./DatePickerDay");
|
|
5
|
+
Object.defineProperty(exports, "DatePickerDay", { enumerable: true, get: function () { return DatePickerDay_1.DatePickerDay; } });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DatePickerDayButton: import("@emotion/styled").StyledComponent<Pick<import("../../Button").ButtonProps, "disabled" | "component" | "href" | "onFocusVisible" | "tabIndex" | "type" | "action" | "children" | "form" | "slot" | "title" | "key" | "css" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon" | "loading" | "loadingIndicator" | "loadingPosition"> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DatePickerDayButton = void 0;
|
|
8
|
+
var Button_1 = require("../../Button");
|
|
9
|
+
var styles_1 = require("../../styles");
|
|
10
|
+
exports.DatePickerDayButton = (0, styles_1.styled)(Button_1.Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: 41px;\n height: 32px;\n"], ["\n min-width: 41px;\n height: 32px;\n"])));
|
|
11
|
+
var templateObject_1;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.DatePickerHeader = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var react_1 = require("react");
|
|
20
|
+
var icons_1 = require("@astral/icons");
|
|
21
|
+
var format_1 = __importDefault(require("date-fns/format"));
|
|
22
|
+
var IconButton_1 = require("../../IconButton");
|
|
23
|
+
var DatePickerProvider_1 = require("../../DatePickerProvider");
|
|
24
|
+
var styled_1 = require("./styled");
|
|
25
|
+
var DatePickerHeader = function (props) {
|
|
26
|
+
var increaseMonth = props.increaseMonth, decreaseMonth = props.decreaseMonth, date = props.date;
|
|
27
|
+
var locale = (0, react_1.useContext)(DatePickerProvider_1.DatePickerContext).locale;
|
|
28
|
+
var localizedDate = (0, react_1.useMemo)(function () { return (0, format_1.default)(date, 'LLLL yyy', { locale: locale }); }, [date]);
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.DatePickerHeaderWrapper, { children: [(0, jsx_runtime_1.jsx)(IconButton_1.IconButton, __assign({ variant: "text", onClick: decreaseMonth }, { children: (0, jsx_runtime_1.jsx)(icons_1.PreviousOutlineMd, {}, void 0) }), void 0), (0, jsx_runtime_1.jsx)(styled_1.DatePickerHeaderTitle, __assign({ variant: "h6" }, { children: localizedDate }), void 0), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, __assign({ variant: "text", onClick: increaseMonth }, { children: (0, jsx_runtime_1.jsx)(icons_1.NextOutlineMd, {}, void 0) }), void 0)] }, void 0));
|
|
30
|
+
};
|
|
31
|
+
exports.DatePickerHeader = DatePickerHeader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePickerHeader } from './DatePickerHeader';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatePickerHeader = void 0;
|
|
4
|
+
var DatePickerHeader_1 = require("./DatePickerHeader");
|
|
5
|
+
Object.defineProperty(exports, "DatePickerHeader", { enumerable: true, get: function () { return DatePickerHeader_1.DatePickerHeader; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DatePickerHeaderWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const DatePickerHeaderTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
7
|
+
align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
|
|
8
|
+
children?: import("react").ReactNode;
|
|
9
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
10
|
+
gutterBottom?: boolean | undefined;
|
|
11
|
+
noWrap?: boolean | undefined;
|
|
12
|
+
paragraph?: boolean | undefined;
|
|
13
|
+
sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
14
|
+
variant?: "inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div" | undefined;
|
|
15
|
+
variantMapping?: Partial<Record<"inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div", string>> | undefined;
|
|
16
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "tabIndex" | "children" | "className" | "slot" | "style" | "title" | "key" | "css" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
|
|
17
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
18
|
+
}, "children" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | ("fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "typography" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DatePickerHeaderTitle = exports.DatePickerHeaderWrapper = void 0;
|
|
8
|
+
var styles_1 = require("../../styles");
|
|
9
|
+
var Typography_1 = require("../../Typography");
|
|
10
|
+
exports.DatePickerHeaderWrapper = styles_1.styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
11
|
+
exports.DatePickerHeaderTitle = (0, styles_1.styled)(Typography_1.Typography)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-transform: capitalize;\n"], ["\n text-transform: capitalize;\n"])));
|
|
12
|
+
var templateObject_1, templateObject_2;
|
package/DatePicker/index.d.ts
CHANGED
package/DatePicker/index.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DatePickerWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DatePickerWrapper = void 0;
|
|
8
|
+
var styles_1 = require("../styles");
|
|
9
|
+
exports.DatePickerWrapper = styles_1.styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .react-datepicker {\n min-width: 320px;\n min-height: 300px;\n margin-top: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n\n &-popper {\n z-index: ", ";\n }\n\n & .react-datepicker__day-names,\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n width: 287px;\n }\n\n & .react-datepicker__day {\n & > button {\n font-weight: ", ";\n }\n\n &--outside-month > button {\n color: ", ";\n }\n\n &--disabled > button {\n color: ", ";\n font-weight: ", ";\n\n cursor: default;\n }\n\n &--selected > button {\n color: ", ";\n\n background-color: ", ";\n }\n\n &--today > button {\n position: relative;\n\n font-weight: ", ";\n }\n\n &--disabled > button:focus {\n outline: none;\n }\n\n &--disabled:not(.react-datepicker__day--selected) > button:hover,\n &--disabled:not(.react-datepicker__day--selected) > button:active {\n background-color: transparent;\n }\n\n &--disabled:focus-visible {\n outline: none;\n }\n\n &--today > button::before {\n position: absolute;\n bottom: ", ";\n\n width: 33px;\n height: 2px;\n\n background-color: ", ";\n\n content: '';\n }\n\n &--today > .react-datepicker__day--selected > button::before {\n background-color: ", ";\n }\n\n &-name {\n width: 41px;\n margin-top: ", ";\n margin-bottom: ", ";\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n text-align: center;\n text-transform: uppercase;\n }\n }\n }\n"], ["\n .react-datepicker {\n min-width: 320px;\n min-height: 300px;\n margin-top: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n\n &-popper {\n z-index: ", ";\n }\n\n & .react-datepicker__day-names,\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n width: 287px;\n }\n\n & .react-datepicker__day {\n & > button {\n font-weight: ", ";\n }\n\n &--outside-month > button {\n color: ", ";\n }\n\n &--disabled > button {\n color: ", ";\n font-weight: ", ";\n\n cursor: default;\n }\n\n &--selected > button {\n color: ", ";\n\n background-color: ", ";\n }\n\n &--today > button {\n position: relative;\n\n font-weight: ", ";\n }\n\n &--disabled > button:focus {\n outline: none;\n }\n\n &--disabled:not(.react-datepicker__day--selected) > button:hover,\n &--disabled:not(.react-datepicker__day--selected) > button:active {\n background-color: transparent;\n }\n\n &--disabled:focus-visible {\n outline: none;\n }\n\n &--today > button::before {\n position: absolute;\n bottom: ", ";\n\n width: 33px;\n height: 2px;\n\n background-color: ", ";\n\n content: '';\n }\n\n &--today > .react-datepicker__day--selected > button::before {\n background-color: ", ";\n }\n\n &-name {\n width: 41px;\n margin-top: ", ";\n margin-bottom: ", ";\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n text-align: center;\n text-transform: uppercase;\n }\n }\n }\n"])), function (_a) {
|
|
10
|
+
var theme = _a.theme;
|
|
11
|
+
return theme.spacing(2);
|
|
12
|
+
}, function (_a) {
|
|
13
|
+
var theme = _a.theme;
|
|
14
|
+
return theme.spacing(4);
|
|
15
|
+
}, function (_a) {
|
|
16
|
+
var theme = _a.theme;
|
|
17
|
+
return theme.palette.background.paper;
|
|
18
|
+
}, function (_a) {
|
|
19
|
+
var theme = _a.theme;
|
|
20
|
+
return theme.spacing(1);
|
|
21
|
+
}, function (_a) {
|
|
22
|
+
var theme = _a.theme;
|
|
23
|
+
return theme.elevation[200];
|
|
24
|
+
}, function (_a) {
|
|
25
|
+
var theme = _a.theme;
|
|
26
|
+
return theme.zIndex.drawer;
|
|
27
|
+
}, function (_a) {
|
|
28
|
+
var theme = _a.theme;
|
|
29
|
+
return theme.typography.fontWeightRegular;
|
|
30
|
+
}, function (_a) {
|
|
31
|
+
var theme = _a.theme;
|
|
32
|
+
return theme.palette.grey[600];
|
|
33
|
+
}, function (_a) {
|
|
34
|
+
var theme = _a.theme;
|
|
35
|
+
return theme.palette.grey[300];
|
|
36
|
+
}, function (_a) {
|
|
37
|
+
var theme = _a.theme;
|
|
38
|
+
return theme.typography.fontWeightRegular;
|
|
39
|
+
}, function (_a) {
|
|
40
|
+
var theme = _a.theme;
|
|
41
|
+
return theme.palette.common.white;
|
|
42
|
+
}, function (_a) {
|
|
43
|
+
var theme = _a.theme;
|
|
44
|
+
return theme.palette.primary.main;
|
|
45
|
+
}, function (_a) {
|
|
46
|
+
var theme = _a.theme;
|
|
47
|
+
return theme.typography.fontWeightMedium;
|
|
48
|
+
}, function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return theme.spacing(1);
|
|
51
|
+
}, function (_a) {
|
|
52
|
+
var theme = _a.theme;
|
|
53
|
+
return theme.palette.primary[900];
|
|
54
|
+
}, function (_a) {
|
|
55
|
+
var theme = _a.theme;
|
|
56
|
+
return theme.palette.primary[200];
|
|
57
|
+
}, function (_a) {
|
|
58
|
+
var theme = _a.theme;
|
|
59
|
+
return theme.spacing(3);
|
|
60
|
+
}, function (_a) {
|
|
61
|
+
var theme = _a.theme;
|
|
62
|
+
return theme.spacing(2);
|
|
63
|
+
}, function (_a) {
|
|
64
|
+
var theme = _a.theme;
|
|
65
|
+
return theme.palette.grey[600];
|
|
66
|
+
}, function (_a) {
|
|
67
|
+
var theme = _a.theme;
|
|
68
|
+
return theme.typography.fontWeightMedium;
|
|
69
|
+
}, function (_a) {
|
|
70
|
+
var theme = _a.theme;
|
|
71
|
+
return theme.typography.h7.fontSize;
|
|
72
|
+
});
|
|
73
|
+
var templateObject_1;
|
package/DatePicker/types.d.ts
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import { DatePickerProps as MuiDatePickerProps } from '@mui/lab';
|
|
2
|
-
export declare type DatePickerProps = Omit<MuiDatePickerProps<Date>, 'components' | 'renderInput' | 'showDaysOutsideCurrentMonth' | 'components' | 'componentsProps' | 'OpenPickerButtonProps' | 'PaperProps' | 'PopperProps'>;
|
|
3
1
|
export declare type DatePickerValue = Date;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare const DatePickerContext: import("react").Context<{
|
|
3
|
+
locale: Locale;
|
|
4
|
+
}>;
|
|
5
|
+
declare type Props = {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Локализация
|
|
9
|
+
*/
|
|
10
|
+
locale?: Locale;
|
|
11
|
+
};
|
|
12
|
+
export declare const DatePickerProvider: (props: Props) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.DatePickerProvider = exports.DatePickerContext = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var react_1 = require("react");
|
|
20
|
+
var ru_1 = __importDefault(require("date-fns/locale/ru"));
|
|
21
|
+
exports.DatePickerContext = (0, react_1.createContext)({ locale: ru_1.default });
|
|
22
|
+
var DatePickerProvider = function (props) {
|
|
23
|
+
var children = props.children, _a = props.locale, locale = _a === void 0 ? ru_1.default : _a;
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(exports.DatePickerContext.Provider, __assign({ value: { locale: locale } }, { children: children }), void 0));
|
|
25
|
+
};
|
|
26
|
+
exports.DatePickerProvider = DatePickerProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DatePickerProvider';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./DatePickerProvider"), exports);
|