@popsure/dirty-swan 0.45.0-alpha → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +421 -362
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/button/index.d.ts +4 -9
- package/dist/cjs/lib/components/button/index.stories.d.ts +2 -10
- package/dist/cjs/lib/components/dateSelector/components/Calendar.d.ts +16 -0
- package/dist/cjs/lib/components/dateSelector/index.d.ts +5 -7
- package/dist/cjs/lib/components/dateSelector/index.stories.d.ts +1 -1
- package/dist/cjs/lib/components/input/currency/input.stories.d.ts +7 -0
- package/dist/cjs/lib/components/input/index.d.ts +5 -3
- package/dist/cjs/lib/components/input/input.stories.d.ts +11 -3
- package/dist/cjs/lib/components/input/stories/config.d.ts +7 -0
- package/dist/esm/{index-f0e3bc9a.js → Calendar-62c6cf21.js} +24 -150
- package/dist/esm/Calendar-62c6cf21.js.map +1 -0
- package/dist/esm/components/button/index.js +2 -3
- package/dist/esm/components/button/index.js.map +1 -1
- package/dist/esm/components/button/index.stories.js +3 -16
- package/dist/esm/components/button/index.stories.js.map +1 -1
- package/dist/esm/components/card/index.js.map +1 -1
- package/dist/esm/components/card/index.stories.js +2 -2
- package/dist/esm/components/card/index.stories.js.map +1 -1
- package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +7 -10
- package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js.map +1 -1
- package/dist/esm/components/comparisonTable/index.js +2 -0
- package/dist/esm/components/comparisonTable/index.js.map +1 -1
- package/dist/esm/components/dateSelector/components/Calendar.js +11 -0
- package/dist/esm/components/dateSelector/components/Calendar.js.map +1 -0
- package/dist/esm/components/dateSelector/index.js +203 -7
- package/dist/esm/components/dateSelector/index.js.map +1 -1
- package/dist/esm/components/dateSelector/index.stories.js +14 -5
- package/dist/esm/components/dateSelector/index.stories.js.map +1 -1
- package/dist/esm/components/dateSelector/index.test.js +177 -23
- package/dist/esm/components/dateSelector/index.test.js.map +1 -1
- package/dist/esm/components/icon/icons/Info.js +2 -2
- package/dist/esm/components/icon/icons/Info.js.map +1 -1
- package/dist/esm/components/icon/icons.stories.js +1 -1
- package/dist/esm/components/icon/index.stories.js +1 -1
- package/dist/esm/components/input/currency/input.stories.js +1 -1
- package/dist/esm/components/input/iban/index.js +1 -1
- package/dist/esm/components/input/iban/index.js.map +1 -1
- package/dist/esm/components/input/index.js +10 -7
- package/dist/esm/components/input/index.js.map +1 -1
- package/dist/esm/components/input/input.stories.js +3 -3
- package/dist/esm/components/input/input.stories.js.map +1 -1
- package/dist/esm/{config-56f12c98.js → config-1d276a9d.js} +7 -2
- package/dist/esm/config-1d276a9d.js.map +1 -0
- package/dist/esm/{index-03b0133a.js → index-e506c4ca.js} +3 -3
- package/dist/esm/{index-03b0133a.js.map → index-e506c4ca.js.map} +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/components/button/index.d.ts +4 -9
- package/dist/esm/lib/components/button/index.stories.d.ts +2 -10
- package/dist/esm/lib/components/dateSelector/components/Calendar.d.ts +16 -0
- package/dist/esm/lib/components/dateSelector/index.d.ts +5 -7
- package/dist/esm/lib/components/dateSelector/index.stories.d.ts +1 -1
- package/dist/esm/lib/components/input/currency/input.stories.d.ts +7 -0
- package/dist/esm/lib/components/input/index.d.ts +5 -3
- package/dist/esm/lib/components/input/input.stories.d.ts +11 -3
- package/dist/esm/lib/components/input/stories/config.d.ts +7 -0
- package/package.json +1 -1
- package/src/lib/components/button/index.stories.tsx +1 -26
- package/src/lib/components/button/index.tsx +10 -21
- package/src/lib/components/card/index.tsx +1 -1
- package/src/lib/components/comparisonTable/components/TableInfoButton/index.tsx +5 -30
- package/src/lib/components/comparisonTable/components/TableInfoButton/style.module.scss +6 -2
- package/src/lib/components/dateSelector/components/Calendar.tsx +112 -0
- package/src/lib/components/dateSelector/{datepicker.scss → components/datepicker.scss} +4 -4
- package/src/lib/components/dateSelector/components/style.module.scss +3 -0
- package/src/lib/components/dateSelector/index.stories.tsx +18 -8
- package/src/lib/components/dateSelector/index.test.tsx +118 -20
- package/src/lib/components/dateSelector/index.tsx +196 -227
- package/src/lib/components/dateSelector/style.module.scss +6 -79
- package/src/lib/components/input/iban/index.tsx +1 -1
- package/src/lib/components/input/index.tsx +13 -7
- package/src/lib/components/input/input.stories.tsx +2 -0
- package/src/lib/components/input/stories/config.ts +6 -1
- package/src/lib/components/input/style.module.scss +8 -1
- package/dist/esm/config-56f12c98.js.map +0 -1
- package/dist/esm/index-f0e3bc9a.js.map +0 -1
- package/src/lib/components/dateSelector/icons/chevron-left.svg +0 -3
- package/src/lib/components/dateSelector/icons/chevron-right.svg +0 -3
- package/src/lib/components/dateSelector/index.test.ts +0 -33
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import React, { ReactElement,
|
|
1
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
2
2
|
declare type ButtonVariant = 'filledColor' | 'filledGray' | 'filledWhite' | 'textColor' | 'textWhite' | 'outlineWhite' | 'filledSuccess' | 'filledError';
|
|
3
|
-
declare
|
|
4
|
-
declare type ButtonDefaultAsType = typeof buttonDefaultAs;
|
|
5
|
-
declare type ButtonOwnProps<E> = {
|
|
6
|
-
as?: E;
|
|
3
|
+
declare type ButtonProps = {
|
|
7
4
|
children: ReactNode;
|
|
8
5
|
variant?: ButtonVariant;
|
|
9
6
|
leftIcon?: ReactElement;
|
|
@@ -11,15 +8,13 @@ declare type ButtonOwnProps<E> = {
|
|
|
11
8
|
loading?: boolean;
|
|
12
9
|
hideLabel?: boolean;
|
|
13
10
|
} & Omit<JSX.IntrinsicElements['button'], 'children'>;
|
|
14
|
-
export declare type ButtonProps<E extends ElementType = ButtonDefaultAsType> = ButtonOwnProps<E> & Omit<ComponentProps<E>, keyof ButtonOwnProps<E>>;
|
|
15
11
|
declare const Button: React.ForwardRefExoticComponent<Pick<{
|
|
16
|
-
as?: React.ElementType<any> | undefined;
|
|
17
12
|
children: ReactNode;
|
|
18
13
|
variant?: ButtonVariant | undefined;
|
|
19
14
|
leftIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
20
15
|
rightIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
21
16
|
loading?: boolean | undefined;
|
|
22
17
|
hideLabel?: boolean | undefined;
|
|
23
|
-
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children"
|
|
18
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children">, "className" | "form" | "slot" | "style" | "title" | "children" | "onClick" | "color" | "hidden" | "type" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "placeholder" | "value" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "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" | "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" | "hideLabel" | "loading" | "variant" | "leftIcon" | "rightIcon"> & React.RefAttributes<HTMLButtonElement>>;
|
|
24
19
|
export { Button };
|
|
25
|
-
export type { ButtonVariant };
|
|
20
|
+
export type { ButtonProps, ButtonVariant };
|
|
@@ -3,21 +3,14 @@ import { ButtonProps, ButtonVariant } from '.';
|
|
|
3
3
|
declare const story: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: import("react").ForwardRefExoticComponent<Pick<{
|
|
6
|
-
as?: import("react").ElementType<any> | undefined;
|
|
7
6
|
children: import("react").ReactNode;
|
|
8
7
|
variant?: ButtonVariant | undefined;
|
|
9
8
|
leftIcon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
10
9
|
rightIcon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
11
10
|
loading?: boolean | undefined;
|
|
12
11
|
hideLabel?: boolean | undefined;
|
|
13
|
-
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children"
|
|
12
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "children">, "className" | "form" | "slot" | "style" | "title" | "children" | "onClick" | "color" | "hidden" | "type" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "placeholder" | "value" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "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" | "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" | "hideLabel" | "loading" | "variant" | "leftIcon" | "rightIcon"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
13
|
argTypes: {
|
|
15
|
-
as: {
|
|
16
|
-
control: {
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
description: string;
|
|
20
|
-
};
|
|
21
14
|
children: {
|
|
22
15
|
control: {
|
|
23
16
|
type: string;
|
|
@@ -57,7 +50,7 @@ declare const story: {
|
|
|
57
50
|
};
|
|
58
51
|
};
|
|
59
52
|
export declare const ButtonStory: {
|
|
60
|
-
({
|
|
53
|
+
({ className, loading, children, variant, hideLabel }: ButtonProps): JSX.Element;
|
|
61
54
|
storyName: string;
|
|
62
55
|
};
|
|
63
56
|
export declare const ButtonVariants: ({ children, onClick }: ButtonProps) => JSX.Element;
|
|
@@ -66,5 +59,4 @@ export declare const ButtonWithIcons: ({ children, onClick }: ButtonProps) => JS
|
|
|
66
59
|
export declare const ButtonWithIconOnly: ({ children, onClick }: ButtonProps) => JSX.Element;
|
|
67
60
|
export declare const ButtonLoading: ({ children, onClick }: ButtonProps) => JSX.Element;
|
|
68
61
|
export declare const ButtonDisabled: ({ children, onClick }: ButtonProps) => JSX.Element;
|
|
69
|
-
export declare const ButtonAsOtherComponents: ({ children, as, onClick }: ButtonProps) => JSX.Element;
|
|
70
62
|
export default story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './datepicker.scss';
|
|
2
|
+
export interface CalendarProps {
|
|
3
|
+
dateFormat: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange: (date: string) => void;
|
|
6
|
+
yearBoundaries: {
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
};
|
|
10
|
+
displayCalendar?: boolean;
|
|
11
|
+
dayjsLocale?: ILocale;
|
|
12
|
+
firstDayOfWeek?: number;
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
setCalendarOpen: (isOpen: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const Calendar: ({ dateFormat, value, onChange, yearBoundaries, displayCalendar, dayjsLocale, firstDayOfWeek, setCalendarOpen, isOpen }: CalendarProps) => JSX.Element | null;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import './datepicker.scss';
|
|
2
|
-
export declare const fillArray: (from: number, to: number) => number[];
|
|
3
|
-
export declare const daysInMonthOfYear: ({ month, year, }: {
|
|
4
|
-
month: number;
|
|
5
|
-
year: number;
|
|
6
|
-
}) => number;
|
|
7
1
|
export interface DateSelectorProps {
|
|
8
2
|
value?: string;
|
|
9
3
|
onChange: (date: string) => void;
|
|
@@ -15,9 +9,13 @@ export interface DateSelectorProps {
|
|
|
15
9
|
dayjsLocale?: ILocale;
|
|
16
10
|
placeholders?: {
|
|
17
11
|
day?: string;
|
|
12
|
+
dayFormat?: string;
|
|
18
13
|
month?: string;
|
|
14
|
+
monthFormat?: string;
|
|
19
15
|
year?: string;
|
|
16
|
+
yearFormat?: string;
|
|
17
|
+
error?: string;
|
|
20
18
|
};
|
|
21
19
|
firstDayOfWeek?: number;
|
|
22
20
|
}
|
|
23
|
-
export declare const DateSelector: ({ value, onChange, yearBoundaries, displayCalendar,
|
|
21
|
+
export declare const DateSelector: ({ value, onChange, placeholders: placeholdersProps, yearBoundaries, displayCalendar, dayjsLocale, firstDayOfWeek, }: DateSelectorProps) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateSelectorProps } from '.';
|
|
2
2
|
declare const story: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ value, onChange, yearBoundaries, displayCalendar,
|
|
4
|
+
component: ({ value, onChange, placeholders: placeholdersProps, yearBoundaries, displayCalendar, dayjsLocale, firstDayOfWeek, }: DateSelectorProps) => JSX.Element;
|
|
5
5
|
decorators: ((Story: any) => JSX.Element)[];
|
|
6
6
|
argTypes: {
|
|
7
7
|
yearBoundaries: {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare type InputProps = Omit<JSX.IntrinsicElements['input'], 'enterKeyHint'> & Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>> & {
|
|
3
|
-
error?: string;
|
|
3
|
+
error?: string | boolean;
|
|
4
4
|
prefix?: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
id?: string;
|
|
7
7
|
hideLabel?: boolean;
|
|
8
|
+
labelInsideInput?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare const Input: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint"> & Partial<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint">> & {
|
|
10
|
-
error?: string | undefined;
|
|
11
|
+
error?: string | boolean | undefined;
|
|
11
12
|
prefix?: string | undefined;
|
|
12
13
|
label?: string | undefined;
|
|
13
14
|
id?: string | undefined;
|
|
14
15
|
hideLabel?: boolean | undefined;
|
|
15
|
-
|
|
16
|
+
labelInsideInput?: boolean | undefined;
|
|
17
|
+
}, "className" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "children" | "onClick" | "error" | "size" | "color" | "hidden" | "type" | "list" | "enterKeyHint" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "placeholder" | "readOnly" | "required" | "src" | "step" | "value" | "width" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "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" | "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" | "hideLabel" | "labelInsideInput"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -3,12 +3,13 @@ import { InputProps } from '.';
|
|
|
3
3
|
declare const story: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint"> & Partial<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "enterKeyHint">> & {
|
|
6
|
-
error?: string | undefined;
|
|
6
|
+
error?: string | boolean | undefined;
|
|
7
7
|
prefix?: string | undefined;
|
|
8
8
|
label?: string | undefined;
|
|
9
9
|
id?: string | undefined;
|
|
10
10
|
hideLabel?: boolean | undefined;
|
|
11
|
-
|
|
11
|
+
labelInsideInput?: boolean | undefined;
|
|
12
|
+
}, "className" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "children" | "onClick" | "error" | "size" | "color" | "hidden" | "type" | "list" | "enterKeyHint" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "name" | "placeholder" | "readOnly" | "required" | "src" | "step" | "value" | "width" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "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" | "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" | "hideLabel" | "labelInsideInput"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
13
|
argTypes: {
|
|
13
14
|
value: {
|
|
14
15
|
defaultValue: string;
|
|
@@ -45,6 +46,13 @@ declare const story: {
|
|
|
45
46
|
type: string;
|
|
46
47
|
};
|
|
47
48
|
};
|
|
49
|
+
labelInsideInput: {
|
|
50
|
+
description: string;
|
|
51
|
+
defaultValue: boolean;
|
|
52
|
+
control: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
48
56
|
prefix: {
|
|
49
57
|
description: string;
|
|
50
58
|
defaultValue: string;
|
|
@@ -84,7 +92,7 @@ declare const story: {
|
|
|
84
92
|
};
|
|
85
93
|
};
|
|
86
94
|
export declare const InputStory: {
|
|
87
|
-
({ onChange, className, placeholder, value, label, hideLabel, prefix, error }: InputProps): JSX.Element;
|
|
95
|
+
({ onChange, className, placeholder, value, label, hideLabel, labelInsideInput, prefix, error }: InputProps): JSX.Element;
|
|
88
96
|
storyName: string;
|
|
89
97
|
};
|
|
90
98
|
export default story;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { _ as __assign } from './tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import require$$0__default, { useEffect,
|
|
3
|
+
import require$$0__default, { useEffect, useRef } from 'react';
|
|
4
4
|
import { c as commonjsGlobal, a as getDefaultExportFromCjs } from './_commonjsHelpers-e7f67fd8.js';
|
|
5
5
|
import CalendarIcon from './components/icon/icons/Calendar.js';
|
|
6
6
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
7
|
+
import { Button } from './components/button/index.js';
|
|
7
8
|
|
|
8
9
|
var dayjs_min = {exports: {}};
|
|
9
10
|
|
|
@@ -13,14 +14,6 @@ var dayjs_min = {exports: {}};
|
|
|
13
14
|
|
|
14
15
|
var dayjs = dayjs_min.exports;
|
|
15
16
|
|
|
16
|
-
var localeData$1 = {exports: {}};
|
|
17
|
-
|
|
18
|
-
(function (module, exports) {
|
|
19
|
-
!function(n,e){module.exports=e();}(commonjsGlobal,(function(){return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.substr(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return {months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return {firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)};}}));
|
|
20
|
-
}(localeData$1));
|
|
21
|
-
|
|
22
|
-
var localeData = localeData$1.exports;
|
|
23
|
-
|
|
24
17
|
var build = {};
|
|
25
18
|
|
|
26
19
|
var DayPicker$2 = {};
|
|
@@ -1995,39 +1988,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
1995
1988
|
|
|
1996
1989
|
var DayPicker = /*@__PURE__*/getDefaultExportFromCjs(build);
|
|
1997
1990
|
|
|
1998
|
-
var customParseFormat$1 = {exports: {}};
|
|
1999
|
-
|
|
2000
|
-
(function (module, exports) {
|
|
2001
|
-
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^\s\d-_:/()]+/,o={},s=function(t){return (t=+t)+(t>68?1900:2e3)};var a=function(t){return function(e){this[t]=+e;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t);}],u=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},h=function(t,e){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(t.indexOf(r(i,0,e))>-1){n=i>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[i,function(t){this.afternoon=h(t,!1);}],a:[i,function(t){this.afternoon=h(t,!0);}],S:[/\d/,function(t){this.milliseconds=100*+t;}],SS:[n,function(t){this.milliseconds=10*+t;}],SSS:[/\d{3}/,function(t){this.milliseconds=+t;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(t){var e=u("months"),n=(u("monthsShort")||e.map((function(t){return t.substr(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var o=r&&r.toUpperCase();return n||i[r]||t[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,f=0;f<a;f+=1){var u=s[f],h=d[u],c=h&&h[0],l=h&&h[1];s[f]=l?{regex:c,parser:l}:u.replace(/^\[|\]$/g,"");}return function(t){for(var e={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,u=t.substr(r),h=o.exec(u)[0];f.call(e,h),t=t.replace(h,"");}}return function(t){var e=t.afternoon;if(void 0!==e){var n=t.hours;e?n<12&&(t.hours+=12):12===n&&(t.hours=0),delete t.afternoon;}}(e),e}}return function(t,e,n){n.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(s=t.parseTwoDigitYear);var r=e.prototype,i=r.parse;r.parse=function(t){var e=t.date,r=t.utc,s=t.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],u=!0===s[3],h=f||u,d=s[2];u&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(t,e,n){try{if(["x","X"].indexOf(e)>-1)return new Date(("X"===e?1e3:1)*t);var r=c(e)(t),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,u=r.seconds,h=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=u||0,g=h||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(t){return new Date("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),h&&e!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,t);};}}));
|
|
2002
|
-
}(customParseFormat$1));
|
|
2003
|
-
|
|
2004
|
-
var customParseFormat = customParseFormat$1.exports;
|
|
2005
|
-
|
|
2006
|
-
function zerofill(input, size) {
|
|
2007
|
-
if (size === void 0) { size = 2; }
|
|
2008
|
-
var toReturn = String(input);
|
|
2009
|
-
while (toReturn.length < size) {
|
|
2010
|
-
toReturn = '0' + toReturn;
|
|
2011
|
-
}
|
|
2012
|
-
return toReturn;
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
dayjs.extend(customParseFormat);
|
|
2016
|
-
function calendarDateToISODate(calendarDate) {
|
|
2017
|
-
return calendarDate.year + "-" + zerofill(calendarDate.month) + "-" + zerofill(calendarDate.day);
|
|
2018
|
-
}
|
|
2019
|
-
function isoStringtoCalendarDate(input) {
|
|
2020
|
-
var date = dayjs(input, 'YYYY-MM-DD');
|
|
2021
|
-
var dateValidity = dayjs(input, 'YYYY-MM-DD', true).isValid();
|
|
2022
|
-
if (dateValidity === false) {
|
|
2023
|
-
return;
|
|
2024
|
-
}
|
|
2025
|
-
var year = date.year();
|
|
2026
|
-
var month = date.get('month');
|
|
2027
|
-
var day = date.date();
|
|
2028
|
-
return { year: year, month: month + 1, day: day };
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
1991
|
var useOnClickOutside = function (ref, callback) {
|
|
2032
1992
|
useEffect(function () {
|
|
2033
1993
|
var listener = function (event) {
|
|
@@ -2045,59 +2005,18 @@ var useOnClickOutside = function (ref, callback) {
|
|
|
2045
2005
|
}, [ref, callback]);
|
|
2046
2006
|
};
|
|
2047
2007
|
|
|
2048
|
-
var css_248z = ".style-
|
|
2049
|
-
var styles = {"container":"style-
|
|
2008
|
+
var css_248z = ".style-module_container__3SY_g {\n position: relative;\n}";
|
|
2009
|
+
var styles = {"container":"style-module_container__3SY_g"};
|
|
2050
2010
|
styleInject(css_248z);
|
|
2051
2011
|
|
|
2052
|
-
|
|
2053
|
-
var
|
|
2054
|
-
/*
|
|
2055
|
-
Fill an array with an increment from a number to another number.
|
|
2056
|
-
i.e. fillArray from 1 to 4 will return the following: [1, 2, 3, 4]
|
|
2057
|
-
|
|
2058
|
-
You can fill descending by flipping the to value
|
|
2059
|
-
i.e. fillArray from 4 to 1 will return the following: [4, 3, 2, 1]
|
|
2060
|
-
*/
|
|
2061
|
-
var fillArray = function (from, to) {
|
|
2062
|
-
var ascending = from > to;
|
|
2063
|
-
var arraySize = Math.abs(from - to) + 1;
|
|
2064
|
-
var toReturn = new Array(arraySize).fill(0).map(function (_, index) {
|
|
2065
|
-
return ascending ? to + index : from + index;
|
|
2066
|
-
});
|
|
2067
|
-
if (ascending) {
|
|
2068
|
-
return toReturn.reverse();
|
|
2069
|
-
}
|
|
2070
|
-
return toReturn;
|
|
2071
|
-
};
|
|
2072
|
-
/*
|
|
2073
|
-
Return the maximum number of days given a month and a year.
|
|
2074
|
-
*/
|
|
2075
|
-
var daysInMonthOfYear = function (_a) {
|
|
2076
|
-
var month = _a.month, year = _a.year;
|
|
2077
|
-
return dayjs(year + "-" + month).daysInMonth();
|
|
2078
|
-
};
|
|
2079
|
-
var DateSelector = function (_a) {
|
|
2080
|
-
var _b, _c, _d;
|
|
2081
|
-
var value = _a.value, onChange = _a.onChange, yearBoundaries = _a.yearBoundaries, displayCalendar = _a.displayCalendar, placeholders = _a.placeholders, dayjsLocale = _a.dayjsLocale, _e = _a.firstDayOfWeek, firstDayOfWeek = _e === void 0 ? 0 : _e;
|
|
2082
|
-
var calendarDateValue = value ? isoStringtoCalendarDate(value) : undefined;
|
|
2083
|
-
var daysInSelectedDate = calendarDateValue
|
|
2084
|
-
? daysInMonthOfYear({
|
|
2085
|
-
month: calendarDateValue.month,
|
|
2086
|
-
year: calendarDateValue.year,
|
|
2087
|
-
})
|
|
2088
|
-
: 31;
|
|
2012
|
+
var Calendar = function (_a) {
|
|
2013
|
+
var dateFormat = _a.dateFormat, value = _a.value, onChange = _a.onChange, yearBoundaries = _a.yearBoundaries, displayCalendar = _a.displayCalendar, dayjsLocale = _a.dayjsLocale, firstDayOfWeek = _a.firstDayOfWeek, setCalendarOpen = _a.setCalendarOpen, isOpen = _a.isOpen;
|
|
2089
2014
|
var localeDate = dayjsLocale
|
|
2090
2015
|
? dayjs().locale(dayjsLocale).localeData()
|
|
2091
2016
|
: dayjs().locale('en').localeData();
|
|
2092
2017
|
var localizedWeekdays = localeDate.weekdays();
|
|
2093
2018
|
var localizedWeekdaysShort = localeDate.weekdaysShort();
|
|
2094
2019
|
var localizedMonths = localeDate.months();
|
|
2095
|
-
var localizedMonthsShort = localeDate.monthsShort();
|
|
2096
|
-
var availableDays = fillArray(1, daysInSelectedDate);
|
|
2097
|
-
var availableYears = fillArray(yearBoundaries.max, yearBoundaries.min);
|
|
2098
|
-
var availableMonths = localizedMonthsShort;
|
|
2099
|
-
var _f = useState(calendarDateValue !== null && calendarDateValue !== void 0 ? calendarDateValue : {}), date = _f[0], setDate = _f[1];
|
|
2100
|
-
var _g = useState(false), openCalendar = _g[0], setOpenCalendar = _g[1];
|
|
2101
2020
|
var calendarContainerRef = useRef(null);
|
|
2102
2021
|
var calendarDefaultDate = dayjs().year() >= yearBoundaries.min && dayjs().year() <= yearBoundaries.max
|
|
2103
2022
|
? dayjs().toDate()
|
|
@@ -2111,68 +2030,23 @@ var DateSelector = function (_a) {
|
|
|
2111
2030
|
var dateCalendarToMonth = dayjs(String(yearBoundaries.max))
|
|
2112
2031
|
.endOf('year')
|
|
2113
2032
|
.toDate();
|
|
2114
|
-
useOnClickOutside(calendarContainerRef, function () { return
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
month: date.month,
|
|
2131
|
-
year: date.year,
|
|
2132
|
-
}));
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
}, [date]); //eslint-disable-line react-hooks/exhaustive-deps
|
|
2136
|
-
var handleOnChange = function (key, v) {
|
|
2137
|
-
var _a;
|
|
2138
|
-
var newValue = __assign(__assign({}, date), (_a = {}, _a[key] = v, _a));
|
|
2139
|
-
if (key !== 'day' &&
|
|
2140
|
-
newValue.month !== undefined &&
|
|
2141
|
-
newValue.year !== undefined &&
|
|
2142
|
-
newValue.day !== undefined) {
|
|
2143
|
-
var cappedDays = Math.min(daysInMonthOfYear({ month: newValue.month, year: newValue.year }), newValue.day);
|
|
2144
|
-
setDate(__assign(__assign({}, newValue), { day: cappedDays }));
|
|
2145
|
-
}
|
|
2146
|
-
else {
|
|
2147
|
-
setDate(newValue);
|
|
2148
|
-
}
|
|
2149
|
-
setOpenCalendar(false);
|
|
2150
|
-
};
|
|
2151
|
-
return (jsxs("div", __assign({ className: styles.container }, { children: [jsxs("div", __assign({ className: styles['date-selector-container'] }, { children: [jsxs("div", __assign({ className: styles['row-container'] }, { children: [jsxs("select", __assign({ "data-cy": "date-selector-day", className: "p-select " + styles['day-select'], id: "day", name: "day", required: true, value: (_b = date.day) !== null && _b !== void 0 ? _b : '', onChange: function (e) {
|
|
2152
|
-
handleOnChange('day', parseInt(e.target.value, 10));
|
|
2153
|
-
} }, { children: [jsx("option", __assign({ value: "", disabled: true }, { children: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.day) || 'Day' }), void 0),
|
|
2154
|
-
availableDays.map(function (day) { return (jsx("option", __assign({ value: day }, { children: day }), day)); })] }), void 0),
|
|
2155
|
-
jsxs("select", __assign({ "data-cy": "date-selector-month", className: "p-select " + styles['month-select'], id: "month", name: "month", required: true, value: (_c = date.month) !== null && _c !== void 0 ? _c : '', onChange: function (e) {
|
|
2156
|
-
handleOnChange('month', parseInt(e.target.value, 10));
|
|
2157
|
-
} }, { children: [jsx("option", __assign({ value: "", disabled: true }, { children: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.month) || 'Month' }), void 0),
|
|
2158
|
-
availableMonths.map(function (month, i) { return (jsx("option", __assign({ value: i + 1 }, { children: month }), month)); })] }), void 0)] }), void 0),
|
|
2159
|
-
jsxs("select", __assign({ "data-cy": "date-selector-year", className: "p-select " + styles['year-select'], id: "year", name: "year", required: true, value: (_d = date.year) !== null && _d !== void 0 ? _d : '', onChange: function (e) {
|
|
2160
|
-
handleOnChange('year', parseInt(e.target.value, 10));
|
|
2161
|
-
} }, { children: [jsx("option", __assign({ value: "", disabled: true }, { children: (placeholders === null || placeholders === void 0 ? void 0 : placeholders.year) || 'Year' }), void 0),
|
|
2162
|
-
availableYears.map(function (year) { return (jsx("option", __assign({ value: year }, { children: year }), year)); })] }), void 0)] }), void 0),
|
|
2163
|
-
displayCalendar && (jsxs("div", __assign({ className: styles['date-calendar-container'], ref: calendarContainerRef }, { children: [jsx("button", __assign({ type: "button", onClick: function () { return setOpenCalendar(!openCalendar); }, className: styles.calendarButton, "data-testid": "calendar-button" }, { children: jsx(CalendarIcon, { color: 'purple-500', size: 24, className: "" + styles.calendarIcon }, void 0) }), void 0),
|
|
2164
|
-
openCalendar && (jsx(DayPicker, { month: selectedDateInDateType, showOutsideDays: true, fromMonth: dateCalendarFromMonth, toMonth: dateCalendarToMonth, selectedDays: selectedDateInDateType, onDayClick: function (date) {
|
|
2165
|
-
if (dayjs(date).isAfter(dateCalendarFromMonth) ||
|
|
2166
|
-
dayjs(date).isBefore(dateCalendarToMonth)) {
|
|
2167
|
-
var selectedDate = dayjs(date).format(COLLECTABLE_DATE_FORMAT);
|
|
2168
|
-
onChange(selectedDate);
|
|
2169
|
-
setOpenCalendar(false);
|
|
2170
|
-
}
|
|
2171
|
-
}, pagedNavigation: true, disabledDays: {
|
|
2172
|
-
before: dateCalendarFromMonth,
|
|
2173
|
-
after: dateCalendarToMonth,
|
|
2174
|
-
}, firstDayOfWeek: firstDayOfWeek, locale: (dayjsLocale === null || dayjsLocale === void 0 ? void 0 : dayjsLocale.name) || 'en', months: localizedMonths, weekdaysLong: localizedWeekdays, weekdaysShort: localizedWeekdaysShort }, void 0))] }), void 0))] }), void 0));
|
|
2033
|
+
useOnClickOutside(calendarContainerRef, function () { return setCalendarOpen(false); });
|
|
2034
|
+
if (!displayCalendar) {
|
|
2035
|
+
return null;
|
|
2036
|
+
}
|
|
2037
|
+
return (jsxs("div", __assign({ className: styles.container + " ml8", ref: calendarContainerRef }, { children: [jsx(Button, __assign({ onClick: function () { return setCalendarOpen(!isOpen); }, "data-testid": "calendar-button", hideLabel: true, variant: 'textColor', leftIcon: jsx(CalendarIcon, {}, void 0) }, { children: "Select date" }), void 0),
|
|
2038
|
+
isOpen && (jsx(DayPicker, { month: selectedDateInDateType, showOutsideDays: true, fromMonth: dateCalendarFromMonth, toMonth: dateCalendarToMonth, selectedDays: selectedDateInDateType, onDayClick: function (date) {
|
|
2039
|
+
if (dayjs(date).isAfter(dateCalendarFromMonth) ||
|
|
2040
|
+
dayjs(date).isBefore(dateCalendarToMonth)) {
|
|
2041
|
+
var selectedDate = dayjs(date).format(dateFormat);
|
|
2042
|
+
onChange(selectedDate);
|
|
2043
|
+
setCalendarOpen(false);
|
|
2044
|
+
}
|
|
2045
|
+
}, pagedNavigation: true, disabledDays: {
|
|
2046
|
+
before: dateCalendarFromMonth,
|
|
2047
|
+
after: dateCalendarToMonth,
|
|
2048
|
+
}, firstDayOfWeek: firstDayOfWeek, locale: (dayjsLocale === null || dayjsLocale === void 0 ? void 0 : dayjsLocale.name) || 'en', months: localizedMonths, weekdaysLong: localizedWeekdays, weekdaysShort: localizedWeekdaysShort }, void 0))] }), void 0));
|
|
2175
2049
|
};
|
|
2176
2050
|
|
|
2177
|
-
export {
|
|
2178
|
-
//# sourceMappingURL=
|
|
2051
|
+
export { Calendar as C, dayjs as a, dayjs_min as d };
|
|
2052
|
+
//# sourceMappingURL=Calendar-62c6cf21.js.map
|